diff --git a/lib/bcoin/pool.js b/lib/bcoin/pool.js index 56bafde3..8a8e2baa 100644 --- a/lib/bcoin/pool.js +++ b/lib/bcoin/pool.js @@ -348,17 +348,19 @@ Pool.prototype.watch = function watch(id) { return; } - var hid = utils.toHex(id); - if (this.watchMap[hid]) - this.watchMap[hid]++; - else - this.watchMap[hid] = 1; + if (id) { + var hid = utils.toHex(id); + if (this.watchMap[hid]) + this.watchMap[hid]++; + else + this.watchMap[hid] = 1; - if (this.bloom.test(id, 'hex')) - return; + if (this.bloom.test(id, 'hex')) + return; - if (id) this.bloom.add(id, 'hex'); + } + if (this.peers.load) this.peers.load.updateWatch(); for (var i = 0; i < this.peers.block.length; i++)