pool: fix bad orphan event handling.
This commit is contained in:
parent
2fb16a6c97
commit
98c975de8b
@ -178,10 +178,18 @@ Pool.prototype._init = function _init() {
|
|||||||
this.logger.info('Chain is fully synced (height=%d).', this.chain.height);
|
this.logger.info('Chain is fully synced (height=%d).', this.chain.height);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.chain.on('bad orphan', (err, id) => {
|
||||||
|
this.handleBadOrphan('block', err, id);
|
||||||
|
});
|
||||||
|
|
||||||
if (this.mempool) {
|
if (this.mempool) {
|
||||||
this.mempool.on('tx', (tx) => {
|
this.mempool.on('tx', (tx) => {
|
||||||
this.emit('tx', tx);
|
this.emit('tx', tx);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.mempool.on('bad orphan', (err, id) => {
|
||||||
|
this.handleBadOrphan('tx', err, id);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.options.selfish && !this.options.spv) {
|
if (!this.options.selfish && !this.options.spv) {
|
||||||
@ -189,10 +197,6 @@ Pool.prototype._init = function _init() {
|
|||||||
this.mempool.on('tx', (tx) => {
|
this.mempool.on('tx', (tx) => {
|
||||||
this.announceTX(tx);
|
this.announceTX(tx);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.mempool.on('bad orphan', (err, id) => {
|
|
||||||
this.handleBadOrphan('tx', err, id);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normally we would also broadcast
|
// Normally we would also broadcast
|
||||||
@ -206,10 +210,6 @@ Pool.prototype._init = function _init() {
|
|||||||
return;
|
return;
|
||||||
this.announceBlock(block);
|
this.announceBlock(block);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.chain.on('bad orphan', (err, id) => {
|
|
||||||
this.handleBadOrphan('block', err, id);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user