From 575dbeabe519edc7bcfcff403722823863bb1b3d Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Wed, 24 Jan 2024 17:01:20 +0000 Subject: [PATCH] fix: correct scale for fee --- lib/plugins/wallet/bitcoind/bitcoind.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plugins/wallet/bitcoind/bitcoind.js b/lib/plugins/wallet/bitcoind/bitcoind.js index efb1444d..e6fc1f0c 100644 --- a/lib/plugins/wallet/bitcoind/bitcoind.js +++ b/lib/plugins/wallet/bitcoind/bitcoind.js @@ -87,7 +87,10 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) { return checkCryptoCode(cryptoCode) .then(() => calculateFeeDiscount(feeMultiplier)) - .then(newFee => fetch('settxfee', [newFee])) + .then(it => { + const newFee = it.shiftedBy(-unitScale).toFixed(8) + return fetch('settxfee', [newFee]) + }) .then(() => fetch('sendtoaddress', [toAddress, coins])) .then((txId) => fetch('gettransaction', [txId])) .then((res) => _.pick(['fee', 'txid'], res))