From 1e6f762c2c3507e30dfba6dbb7e59729321ff9fe Mon Sep 17 00:00:00 2001 From: Rafael Date: Tue, 3 Dec 2024 17:16:52 +0000 Subject: [PATCH] fix: comparator, missing await, print new txid --- bin/lamassu-btc-bumpfee | 11 +++++++---- package.json | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/lamassu-btc-bumpfee b/bin/lamassu-btc-bumpfee index 8bf8cd04..bd17b3af 100644 --- a/bin/lamassu-btc-bumpfee +++ b/bin/lamassu-btc-bumpfee @@ -21,7 +21,7 @@ const bumpTransactionFee = async (txId) => { console.log(`Current fee: ${satPerVb.toFixed(2).toString()} sat/vB`) - const recommendedFees = mempool.getSatBEstimateFees() + const recommendedFees = await mempool.getSatBEstimateFees() console.log('Recommended fees (sat/vB):', recommendedFees) @@ -31,14 +31,17 @@ const bumpTransactionFee = async (txId) => { name: 'selectedFee', message: 'Select a fee higher than the current one:', choices: Object.entries(recommendedFees) - .filter(([_, value]) => satPerVb.gt(value)) + .filter(([_, value]) => satPerVb.lt(value)) .map(([key, value]) => ({name: `${key}: ${value} sat/vB`, value})), }, ]) - await bitcoind.fetch('bumpfee', [txId, {fee_rate: selectedFee}]) + const { txid } = await bitcoind.fetch('bumpfee', [txId, {fee_rate: selectedFee}]) - console.log(`Fee bumped to ${selectedFee.toFixed(2)} sat/vB`) + console.log(` +Fee bumped to ${selectedFee.toFixed(2)} sat/vB +Transaction ID: ${txid} +`) } bumpTransactionFee(txId) \ No newline at end of file diff --git a/package.json b/package.json index 9d4511c6..47798153 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "lamassu-ofac-update": "./bin/lamassu-ofac-update", "lamassu-send-coins": "./bin/lamassu-send-coins", "lamassu-update-to-mnemonic": "./bin/lamassu-update-to-mnemonic", + "lamassu-btc-bumpfee": "./bin/lamassu-btc-bumpfee", "lamassu-update-wallet-nodes": "./bin/lamassu-update-wallet-nodes", "lamassu-configure-frontcamera": "./bin/lamassu-configure-frontcamera", "lamassu-ofac-update-sources": "./bin/lamassu-ofac-update-sources",