Merge pull request #1098 from chaotixkilla/fix-btc-batching-shiftedby
Fix BTC batching promise chain
This commit is contained in:
commit
5aace51618
2 changed files with 4 additions and 3 deletions
|
|
@ -84,10 +84,10 @@ function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) {
|
|||
.then(() => calculateFeeDiscount(feeMultiplier))
|
||||
.then(newFee => fetch('settxfee', [newFee]))
|
||||
.then(() => {
|
||||
const txAddressAmountPairs = _.map(tx => [tx.address, tx.cryptoAtoms.shiftedBy(-unitScale).toFixed(8)], txs)
|
||||
return Promise.all([JSON.stringify(_.fromPairs(txAddressAmountPairs))])
|
||||
const txAddressAmountPairs = _.map(tx => [tx.toAddress, BN(tx.cryptoAtoms).shiftedBy(-unitScale).toFixed(8)], txs)
|
||||
return _.fromPairs(txAddressAmountPairs)
|
||||
})
|
||||
.then(([obj]) => fetch('sendmany', ['', obj]))
|
||||
.then((obj) => fetch('sendmany', ['', obj]))
|
||||
.then((txId) => fetch('gettransaction', [txId]))
|
||||
.then((res) => _.pick(['fee', 'txid'], res))
|
||||
.then((pickedObj) => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue