diff --git a/src/functions/bitcoin/bitcoin-functions.ts b/src/functions/bitcoin/bitcoin-functions.ts index e57551b..4f3f895 100644 --- a/src/functions/bitcoin/bitcoin-functions.ts +++ b/src/functions/bitcoin/bitcoin-functions.ts @@ -226,17 +226,19 @@ export async function getFeeRate( getEstimatedFeeRate(bitcoinBlockchainAPIFeeURL), ]); - const currentBlockFeeRateMultiplied = Math.ceil(currentBlockFeeRate) * multiplier; + const currentBlockFeeRateMultiplied = currentBlockFeeRate * multiplier; const lastTwoBlocksfeeRateAverageMultiplied = (lastTwoBlocksFeeRate.reduce((a, b) => a + b) / lastTwoBlocksFeeRate.length) * multiplier; const estimatedFeeRateMultiplied = estimatedFeeRate * multiplier; - return Math.max( - lastTwoBlocksfeeRateAverageMultiplied, - currentBlockFeeRateMultiplied, - estimatedFeeRateMultiplied + return Math.ceil( + Math.max( + lastTwoBlocksfeeRateAverageMultiplied, + currentBlockFeeRateMultiplied, + estimatedFeeRateMultiplied + ) ); } diff --git a/tests/unit/bitcoin-functions.test.ts b/tests/unit/bitcoin-functions.test.ts index 3c3d0c9..606ec28 100644 --- a/tests/unit/bitcoin-functions.test.ts +++ b/tests/unit/bitcoin-functions.test.ts @@ -8,7 +8,6 @@ import { ecdsaPublicKeyToSchnorr, finalizeUserInputs, getFeeAmount, - getFeeRate, getFeeRecipientAddress, getInputIndicesByScript, getScriptMatchingOutputFromTransaction,