From a3b923ae762acee0fcf2b52606dde8c29a26a95f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 26 May 2014 04:33:36 -0500 Subject: [PATCH] peer: have updateWatch getblocks instead of filterload for the satoshi option. --- lib/bcoin/peer.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index 1368e938..7bc7240e 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -161,7 +161,19 @@ Peer.prototype.broadcast = function broadcast(items) { }; Peer.prototype.updateWatch = function updateWatch() { - if (this.options.satoshi) return; + if (this.options.satoshi) { + if (this.ack) { + var self = this; + if (this.pool.block.lastHash) + this.loadBlocks([ self.pool.block.lastHash ], 0); + else + this.pool.chain.getLast(function(hash) { + self.loadBlocks([ hash ], 0); + }); + } + return; + } + if (this.ack) this._write(this.framer.filterLoad(this.bloom, 'none')); };