fix: usage of .plus function in BN calculation

fix: move batching database writing to transactions
This commit is contained in:
Sérgio Salgado 2021-11-24 15:34:00 +00:00
parent bef24cf3a3
commit f6e793ea4d
2 changed files with 46 additions and 41 deletions

View file

@ -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())