peer: have updateWatch getblocks instead of filterload for the satoshi option.

This commit is contained in:
Christopher Jeffrey 2014-05-26 04:33:36 -05:00
parent 024350dbe4
commit a3b923ae76

View File

@ -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'));
};