diff --git a/lib/plugins/wallet/bitcoind/bitcoind.js b/lib/plugins/wallet/bitcoind/bitcoind.js index 3075a3fa..39914ef4 100644 --- a/lib/plugins/wallet/bitcoind/bitcoind.js +++ b/lib/plugins/wallet/bitcoind/bitcoind.js @@ -85,14 +85,14 @@ function sendCoinsBatch (account, txs, cryptoCode) { .then(() => calculateFeeDiscount(feeMultiplier)) .then(newFee => fetch('settxfee', [newFee])) .then(() => { - const txAddressAmountPairs = _.map(tx => [tx.address, tx.cryptoAtoms.shift(-unitScale).toFixed(8)], txs) + const txAddressAmountPairs = _.map(tx => [tx.address, tx.cryptoAtoms.shiftedBy(-unitScale).toFixed(8)], txs) return Promise.all([JSON.stringify(_.fromPairs(txAddressAmountPairs))]) }) .then(([obj]) => fetch('sendmany', ['', obj])) .then((txId) => fetch('gettransaction', [txId])) .then((res) => _.pick(['fee', 'txid'], res)) .then((pickedObj) => ({ - fee: BN(pickedObj.fee).abs().shift(unitScale).round(), + fee: new BN(pickedObj.fee).abs().shiftedBy(unitScale).decimalPlaces(0), txid: pickedObj.txid })) .catch(err => {