fix: BTC multiplied fee rounding
This commit is contained in:
parent
fb00856cde
commit
d5a794afff
1 changed files with 3 additions and 3 deletions
|
|
@ -69,7 +69,7 @@ function calculateFeeDiscount (feeMultiplier) {
|
|||
if (!estimatedFee) return AUTOMATIC_FEE
|
||||
const newFee = estimatedFee.times(feeMultiplier)
|
||||
if (newFee.lt(0.00001) || newFee.gt(0.1)) return AUTOMATIC_FEE
|
||||
return newFee
|
||||
return newFee.toFixed(8)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
|
|||
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => calculateFeeDiscount(feeMultiplier))
|
||||
.then(newFee => fetch('settxfee', [newFee.toNumber()]))
|
||||
.then(newFee => fetch('settxfee', [newFee]))
|
||||
.then(() => fetch('sendtoaddress', [toAddress, coins]))
|
||||
.then((txId) => fetch('gettransaction', [txId]))
|
||||
.then((res) => _.pick(['fee', 'txid'], res))
|
||||
|
|
@ -95,7 +95,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
|
|||
function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => calculateFeeDiscount(feeMultiplier))
|
||||
.then(newFee => fetch('settxfee', [newFee.toNumber()]))
|
||||
.then(newFee => fetch('settxfee', [newFee]))
|
||||
.then(() => _.reduce((acc, value) => ({
|
||||
...acc,
|
||||
[value.toAddress]: _.isNil(acc[value.toAddress])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue