orphan fork and notfound.
This commit is contained in:
parent
f11f4091f5
commit
9b2d80098a
@ -1376,16 +1376,12 @@ Chain.prototype.add = function add(block, callback, force) {
|
|||||||
// If the orphan chain forked, simply
|
// If the orphan chain forked, simply
|
||||||
// reset the orphans.
|
// reset the orphans.
|
||||||
if (orphan.hash('hex') !== hash) {
|
if (orphan.hash('hex') !== hash) {
|
||||||
self.purgeOrphans();
|
|
||||||
|
|
||||||
self.emit('fork', block, {
|
self.emit('fork', block, {
|
||||||
height: block.getCoinbaseHeight(),
|
height: block.getCoinbaseHeight(),
|
||||||
expected: orphan.hash('hex'),
|
expected: orphan.hash('hex'),
|
||||||
received: hash,
|
received: hash,
|
||||||
checkpoint: false
|
checkpoint: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return done(new VerifyError(block, 'duplicate', 'duplicate', 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.emit('orphan', block, {
|
self.emit('orphan', block, {
|
||||||
|
|||||||
@ -611,6 +611,9 @@ Peer.prototype._onPacket = function onPacket(packet) {
|
|||||||
case 'verack':
|
case 'verack':
|
||||||
this._emit(cmd, payload);
|
this._emit(cmd, payload);
|
||||||
break;
|
break;
|
||||||
|
case 'notfound':
|
||||||
|
this._emit(cmd, payload);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
bcoin.debug('Unknown packet: %s', cmd);
|
bcoin.debug('Unknown packet: %s', cmd);
|
||||||
this._emit(cmd, payload);
|
this._emit(cmd, payload);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user