diff --git a/packages/bitcore-node/src/models/walletAddress.ts b/packages/bitcore-node/src/models/walletAddress.ts index 404f64d47ba..5e524f10aa6 100644 --- a/packages/bitcore-node/src/models/walletAddress.ts +++ b/packages/bitcore-node/src/models/walletAddress.ts @@ -39,7 +39,7 @@ export class WalletAddressModel extends BaseModel { const { chain, network } = wallet; const unprocessedAddresses: Array = []; - return new Promise(async resolve => { + return new Promise(async (resolve, reject) => { for (let address of addresses) { try { const updatedAddress = await this.collection.findOneAndUpdate( @@ -61,7 +61,7 @@ export class WalletAddressModel extends BaseModel { } } catch (err) { // Perhaps a race condition from multiple calls around the same time - console.error('Likely an upsert race condition in walletAddress updates'); + reject('Likely an upsert race condition in walletAddress updates') } }