From 582a21fd5a6252b5d26d40c09dc348941063f158 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 4 Jan 2016 18:31:27 -0800 Subject: [PATCH] getblocks failing for spv. --- lib/bcoin/chain.js | 3 +-- lib/bcoin/fullchain.js | 1 - lib/bcoin/pool.js | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 4ceff1e8..614561c6 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -195,7 +195,6 @@ Chain.prototype._addIndex = function _addIndex(hash, ts, height) { if (checkpoint) { this.emit('checkpoint', height, hash, checkpoint); if (hash !== checkpoint) { - // this.resetLastCheckpoint(height); this.emit('fork', height, hash, checkpoint); return Chain.codes.badCheckpoint; } @@ -361,7 +360,7 @@ Chain.prototype.add = function add(block, peer) { range = this._getRange(hash, block.ts, true); hashes = this.index.hashes.slice(range.start, range.end + 1); - this.emit('missing', prev, hashes, block); + // this.emit('missing', prev, hashes, block); code = Chain.codes.newOrphan; break; } diff --git a/lib/bcoin/fullchain.js b/lib/bcoin/fullchain.js index f6f03014..48d9734c 100644 --- a/lib/bcoin/fullchain.js +++ b/lib/bcoin/fullchain.js @@ -153,7 +153,6 @@ Chain.prototype._addIndex = function _addIndex(entry) { if (checkpoint) { this.emit('checkpoint', entry.height, entry.hash, checkpoint); if (hash !== checkpoint) { - // this.resetLastCheckpoint(entry.height); this.emit('fork', entry.height, entry.hash, checkpoint); return Chain.codes.badCheckpoint; } diff --git a/lib/bcoin/pool.js b/lib/bcoin/pool.js index 6560ad91..183628ab 100644 --- a/lib/bcoin/pool.js +++ b/lib/bcoin/pool.js @@ -46,7 +46,7 @@ function Pool(options) { if (!this.options.fullNode) { if (this.options.headers == null) - this.options.headers = true; + this.options.headers = false; if (this.options.multiplePeers == null) this.options.multiplePeers = true; } else { @@ -177,8 +177,7 @@ Pool.prototype._init = function _init() { this.chain.on('fork', function(height, hash, checkpoint) { var peer = self.peers.load; - if (!self.options.fullNode) - return; + this.emit('debug', 'Checkpoint %s failed at height %d', hash, height); if (!peer) return;