fix: correct scale for fee

This commit is contained in:
Rafael Taranto 2024-01-24 17:01:20 +00:00
parent db468e7a6f
commit 575dbeabe5

View file

@ -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))