aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-03 10:39:33 -0800
committerAdam Soltys <[email protected]>2026-03-03 10:39:33 -0800
commit773907095af3e069da5af9daa5de183586d9584f (patch)
treea1fae2c4e977c5b5095b78c213f92154b2abc8e8
parentfdce612b18571de36216c1ed12fabd349d4e39e2 (diff)
downloadcoinos-server-773907095af3e069da5af9daa5de183586d9584f.tar.gz
coinos-server-773907095af3e069da5af9daa5de183586d9584f.zip
round fees
-rw-r--r--index.ts3
-rw-r--r--lib/payments.ts5
2 files changed, 4 insertions, 4 deletions
diff --git a/index.ts b/index.ts
index 2acf685b..784baa5d 100644
--- a/index.ts
+++ b/index.ts
@@ -5,6 +5,7 @@ import { admin, auth, optional } from "$lib/auth";
import { g, s } from "$lib/db";
import { fixBolt12, listenForLightning, replay } from "$lib/lightning";
+import { l } from "$lib/logging";
import { startHealthCheck } from "$lib/health";
import { getLocations } from "$lib/locations";
import {
@@ -261,7 +262,7 @@ Bun.serve({
hostname: host_,
});
-console.log(`coinos server listening on ${host_}:${port}`);
+l(`coinos server listening on ${host_}:${port}`);
const logerr = (e: Error) => console.log(e);
process.on("unhandledRejection", logerr);
diff --git a/lib/payments.ts b/lib/payments.ts
index 363fb8ff..057a98ca 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -962,7 +962,6 @@ const buildNonCustodial = async ({ aid, amount, address, feeRate, subtract, user
fees.fastestFee = Math.ceil(fees.fastestFee * 1.5);
if (!feeRate) feeRate = fees.halfHourFee;
- if (feeRate < fees.hourFee) fail("fee rate too low");
const nextIndex = account.nextIndex || 0;
@@ -1020,7 +1019,7 @@ const buildNonCustodial = async ({ aid, amount, address, feeRate, subtract, user
let selected = selectUTXO(utxoInputs, outputs, "default", {
changeAddress,
- feePerByte: BigInt(feeRate),
+ feePerByte: BigInt(Math.ceil(feeRate)),
network: btcNetwork,
createTx: true,
});
@@ -1035,7 +1034,7 @@ const buildNonCustodial = async ({ aid, amount, address, feeRate, subtract, user
const maxOutputs = [{ address, amount: BigInt(amount) }];
selected = selectUTXO(utxoInputs, maxOutputs, "all", {
changeAddress,
- feePerByte: BigInt(feeRate),
+ feePerByte: BigInt(Math.ceil(feeRate)),
network: btcNetwork,
createTx: true,
});