add all addresses to bloom filter.

This commit is contained in:
Christopher Jeffrey 2016-06-02 16:26:25 -07:00
parent 6176b0d228
commit 47f75c9957
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 9 additions and 3 deletions

View File

@ -123,6 +123,10 @@ SPVNode.prototype._init = function _init() {
});
});
this.walletdb.on('save address', function(hash) {
self.pool.watch(hash, 'hex');
});
function load(err) {
if (err)
return self.emit('error', err);

View File

@ -835,12 +835,12 @@ Wallet.prototype.syncOutputDepth = function syncOutputDepth(tx, callback) {
if (!account)
return next();
account.setDepth(receiveDepth, changeDepth, function(err, rec, chng) {
account.setDepth(receiveDepth, changeDepth, function(err, rcv, chng) {
if (err)
return next(err);
if (rec)
receive.push(rec);
if (rcv)
receive.push(rcv);
if (chng)
change.push(chng);

View File

@ -682,6 +682,8 @@ WalletDB.prototype.saveAddress = function saveAddress(id, addresses, callback) {
if (self.tx.filter)
self.tx.filter.add(hash[0], 'hex');
self.emit('save address', hash[0], hash[1]);
self.db.fetch('W/' + hash[0], parsePaths, function(err, paths) {
if (err)
return next(err);