We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4172cce commit 4fd7f32Copy full SHA for 4fd7f32
packages/bitcore-node/src/models/transaction.ts
@@ -70,14 +70,14 @@ export class Transaction extends BaseModel<ITransaction> {
70
spendOps = spendOps.map((spendBatch: Array<any>) =>
71
CoinModel.collection.bulkWrite(spendBatch, { ordered: false })
72
);
73
- await Promise.all(spendOps);
74
}
75
76
let txOps = await this.addTransactions(params);
77
logger.debug('Writing Transactions', txOps.length);
78
const txBatches = partition(txOps, txOps.length / config.maxPoolSize);
79
const txs = txBatches.map((txBatch: Array<any>) => this.collection.bulkWrite(txBatch, { ordered: false }));
80
- await Promise.all(txs);
+
+ await Promise.all(spendOps.concat(txs));
81
82
83
async addTransactions(params: {
0 commit comments