diff options
| author | Adam Soltys <[email protected]> | 2026-03-03 10:39:33 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-03 10:39:33 -0800 |
| commit | 773907095af3e069da5af9daa5de183586d9584f (patch) | |
| tree | a1fae2c4e977c5b5095b78c213f92154b2abc8e8 /lib | |
| parent | fdce612b18571de36216c1ed12fabd349d4e39e2 (diff) | |
| download | coinos-server-773907095af3e069da5af9daa5de183586d9584f.tar.gz coinos-server-773907095af3e069da5af9daa5de183586d9584f.zip | |
round fees
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/payments.ts | 5 |
1 files changed, 2 insertions, 3 deletions
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, }); |
