Skip to content

Commit

Permalink
Merge pull request bitpay#745 from matiu/bug/bc-monitor-startup
Browse files Browse the repository at this point in the history
fix bcmonitor startup
  • Loading branch information
matiu committed Dec 26, 2017
2 parents c62c464 + 35d1fc3 commit 9c5abaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/blockchainmonitor.js
Expand Up @@ -223,7 +223,7 @@ BlockchainMonitor.prototype._updateAddressesWithBalance = function(address, cb)
}

addresses.push(address.address);
log.info('Activating address '+address);
log.info('Activating address ' + address.address);
self.storage.storeAddressesWithBalance(address.walletId, addresses, function(err) {
if (err) {
log.warn('Could not update wallet cache', err);
Expand Down
3 changes: 3 additions & 0 deletions lib/storage.js
Expand Up @@ -228,6 +228,7 @@ Storage.prototype._completeTxData = function(walletId, txs, cb) {
// TODO: remove walletId from signature
Storage.prototype.fetchTx = function(walletId, txProposalId, cb) {
var self = this;
if (!this.db) return cb();

this.db.collection(collections.TXS).findOne({
id: txProposalId,
Expand All @@ -241,6 +242,7 @@ Storage.prototype.fetchTx = function(walletId, txProposalId, cb) {

Storage.prototype.fetchTxByHash = function(hash, cb) {
var self = this;
if (!this.db) return cb();

this.db.collection(collections.TXS).findOne({
txid: hash,
Expand Down Expand Up @@ -542,6 +544,7 @@ Storage.prototype.fetchAddressByWalletId = function(walletId, address, cb) {

Storage.prototype.fetchAddressByCoin = function(coin, address, cb) {
var self = this;
if (!this.db) return cb();

this.db.collection(collections.ADDRESSES).find({
address: address,
Expand Down

0 comments on commit 9c5abaf

Please sign in to comment.