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