update active addresses from bc monitor
This commit is contained in:
parent
4198d5c47c
commit
124742a792
|
@ -92,7 +92,7 @@ BlockchainMonitor.prototype._handleTxId = function(data, processIt) {
|
|||
|
||||
self.storage.fetchTxByHash(data.txid, function(err, txp) {
|
||||
if (err) {
|
||||
log.error('Could not fetch tx the db');
|
||||
log.error('Could not fetch tx from the db');
|
||||
return;
|
||||
}
|
||||
if (!txp || txp.status != 'accepted') return;
|
||||
|
@ -164,13 +164,25 @@ BlockchainMonitor.prototype._handleTxOuts = function(data) {
|
|||
},
|
||||
walletId: walletId,
|
||||
});
|
||||
self._storeAndBroadcastNotification(notification, next);
|
||||
self._updateActiveAddresses(address, function() {
|
||||
self._storeAndBroadcastNotification(notification, next);
|
||||
});
|
||||
});
|
||||
}, function(err) {
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
BlockchainMonitor.prototype._updateActiveAddresses = function(address, cb) {
|
||||
var self = this;
|
||||
|
||||
self.storage.storeActiveAddresses(address.walletId, address.address, function(err) {
|
||||
if (err) {
|
||||
log.warn('Could not update wallet cache', err);
|
||||
}
|
||||
return cb(err);
|
||||
});
|
||||
};
|
||||
|
||||
BlockchainMonitor.prototype._handleIncommingTx = function(data) {
|
||||
this._handleTxId(data);
|
||||
|
|
Loading…
Reference in New Issue