From c8388395223e19effa476c8226a1919a32eed003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Thu, 3 Feb 2022 19:10:19 +0000 Subject: [PATCH] fix: add feeMultiplier parameter --- lib/plugins/wallet/bitcoind/bitcoind.js | 2 +- lib/wallet.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/plugins/wallet/bitcoind/bitcoind.js b/lib/plugins/wallet/bitcoind/bitcoind.js index 39914ef4..a778d4b4 100644 --- a/lib/plugins/wallet/bitcoind/bitcoind.js +++ b/lib/plugins/wallet/bitcoind/bitcoind.js @@ -80,7 +80,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) { }) } -function sendCoinsBatch (account, txs, cryptoCode) { +function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) { return checkCryptoCode(cryptoCode) .then(() => calculateFeeDiscount(feeMultiplier)) .then(newFee => fetch('settxfee', [newFee])) diff --git a/lib/wallet.js b/lib/wallet.js index 2b39f260..2653ba77 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -82,7 +82,8 @@ function sendCoins (settings, tx) { function sendCoinsBatch (settings, txs, cryptoCode) { return fetchWallet(settings, cryptoCode) .then(r => { - return r.wallet.sendCoinsBatch(r.account, txs, cryptoCode) + const feeMultiplier = settings[`wallets_${tx.cryptoCode}_feeMultiplier`] + return r.wallet.sendCoinsBatch(r.account, txs, cryptoCode, feeMultiplier) .then(res => { mem.clear(module.exports.balance) return res