diff --git a/packages/bitcore-node/src/models/walletAddress.ts b/packages/bitcore-node/src/models/walletAddress.ts index 7c12c9ac72b..00a8b9b9bcd 100644 --- a/packages/bitcore-node/src/models/walletAddress.ts +++ b/packages/bitcore-node/src/models/walletAddress.ts @@ -69,8 +69,8 @@ export class WalletAddress extends BaseModel { const { walletUpdates, coinUpdates } = updates; const { chain, network } = wallet; - let walletUpdateBatches = partition(walletUpdates, 500); - let coinUpdateBatches = partition(coinUpdates, 500); + let walletUpdateBatches = partition(walletUpdates, walletUpdates.length/4); + let coinUpdateBatches = partition(coinUpdates, coinUpdates.length/4); return new Promise(async resolve => { await Promise.all( @@ -99,7 +99,7 @@ export class WalletAddress extends BaseModel { } }); await Promise.all( - partition(txUpdates, 500).map(txUpdate => { + partition(txUpdates, txUpdates.length/4).map(txUpdate => { return TransactionModel.collection.bulkWrite(txUpdate, { ordered: false }); }) )