pool: minor.

This commit is contained in:
Christopher Jeffrey 2017-01-21 17:06:10 -08:00
parent 6e13fe57c0
commit d516035473
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -587,7 +587,8 @@ Pool.prototype.stopSync = function stopSync() {
*/ */
Pool.prototype.sendSync = co(function* sendSync(peer) { Pool.prototype.sendSync = co(function* sendSync(peer) {
var locator, tip, watermark; var tip = this.chain.tip;
var locator;
if (!this.syncing) if (!this.syncing)
return false; return false;
@ -619,9 +620,7 @@ Pool.prototype.sendSync = co(function* sendSync(peer) {
peer.blockTime = util.ms(); peer.blockTime = util.ms();
if (this.headersFirst) { if (this.headersFirst) {
tip = this.chain.tip; peer.sendGetHeaders([tip.hash], this.headerTip.hash);
watermark = this.headerTip;
peer.sendGetHeaders([tip.hash], watermark.hash);
return true; return true;
} }
@ -629,7 +628,7 @@ Pool.prototype.sendSync = co(function* sendSync(peer) {
locator = yield this.chain.getLocator(); locator = yield this.chain.getLocator();
} catch (e) { } catch (e) {
this.emit('error', e); this.emit('error', e);
return; return false;
} }
peer.sendGetBlocks(locator); peer.sendGetBlocks(locator);