Skip to content

Commit

Permalink
better handling of large wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsujlangston committed Sep 24, 2018
1 parent a9720c0 commit ede612e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/bitcore-node/src/models/walletAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export class WalletAddress extends BaseModel<IWalletAddress> {
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(
Expand Down Expand Up @@ -99,7 +99,7 @@ export class WalletAddress extends BaseModel<IWalletAddress> {
}
});
await Promise.all(
partition(txUpdates, 500).map(txUpdate => {
partition(txUpdates, txUpdates.length/4).map(txUpdate => {
return TransactionModel.collection.bulkWrite(txUpdate, { ordered: false });
})
)
Expand Down

0 comments on commit ede612e

Please sign in to comment.