|
@ -92,7 +92,7 @@ BlockchainMonitor.prototype._handleTxId = function(data, processIt) { |
|
|
|
|
|
|
|
|
self.storage.fetchTxByHash(data.txid, function(err, txp) { |
|
|
self.storage.fetchTxByHash(data.txid, function(err, txp) { |
|
|
if (err) { |
|
|
if (err) { |
|
|
log.error('Could not fetch tx the db'); |
|
|
log.error('Could not fetch tx from the db'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!txp || txp.status != 'accepted') return; |
|
|
if (!txp || txp.status != 'accepted') return; |
|
@ -164,13 +164,25 @@ BlockchainMonitor.prototype._handleTxOuts = function(data) { |
|
|
}, |
|
|
}, |
|
|
walletId: walletId, |
|
|
walletId: walletId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
self._updateActiveAddresses(address, function() { |
|
|
self._storeAndBroadcastNotification(notification, next); |
|
|
self._storeAndBroadcastNotification(notification, next); |
|
|
}); |
|
|
}); |
|
|
|
|
|
}); |
|
|
}, function(err) { |
|
|
}, function(err) { |
|
|
return; |
|
|
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) { |
|
|
BlockchainMonitor.prototype._handleIncommingTx = function(data) { |
|
|
this._handleTxId(data); |
|
|
this._handleTxId(data); |
|
|