fix: usage of .plus function in BN calculation
fix: move batching database writing to transactions
This commit is contained in:
parent
bef24cf3a3
commit
f6e793ea4d
2 changed files with 46 additions and 41 deletions
|
|
@ -65,7 +65,7 @@ function sendCoinsBatch (account, txs, cryptoCode) {
|
|||
sendCount = sendCount + txs.length
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
const cryptoSum = _.reduce((acc, value) => acc.add(value.crypto_atoms), BN(0), txs)
|
||||
const cryptoSum = _.reduce((acc, value) => acc.plus(value.crypto_atoms), BN(0), txs)
|
||||
if (isInsufficient(cryptoSum, cryptoCode)) {
|
||||
console.log('[%s] DEBUG: Mock wallet insufficient funds: %s',
|
||||
cryptoCode, cryptoSum.toString())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue