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
|
||||
// reset the orphans.
|
||||
if (orphan.hash('hex') !== hash) {
|
||||
self.purgeOrphans();
|
||||
|
||||
self.emit('fork', block, {
|
||||
height: block.getCoinbaseHeight(),
|
||||
expected: orphan.hash('hex'),
|
||||
received: hash,
|
||||
checkpoint: false
|
||||
});
|
||||
|
||||
return done(new VerifyError(block, 'duplicate', 'duplicate', 0));
|
||||
}
|
||||
|
||||
self.emit('orphan', block, {
|
||||
|
||||
@ -611,6 +611,9 @@ Peer.prototype._onPacket = function onPacket(packet) {
|
||||
case 'verack':
|
||||
this._emit(cmd, payload);
|
||||
break;
|
||||
case 'notfound':
|
||||
this._emit(cmd, payload);
|
||||
break;
|
||||
default:
|
||||
bcoin.debug('Unknown packet: %s', cmd);
|
||||
this._emit(cmd, payload);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user