getblocks failing for spv.

This commit is contained in:
Christopher Jeffrey 2016-01-04 18:31:27 -08:00
parent 0a97cebf25
commit 582a21fd5a
3 changed files with 3 additions and 6 deletions

View File

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

View File

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

View File

@ -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;