mempool: fix orphan resolution edge case.

This commit is contained in:
Christopher Jeffrey 2017-09-26 20:22:54 -07:00
parent 1aa78e2248
commit ca4e938a75
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1562,7 +1562,16 @@ Mempool.prototype.handleOrphans = async function handleOrphans(parent) {
throw err;
}
assert(!missing || missing.length === 0);
// Can happen if an existing parent is
// evicted in the interim between fetching
// the non-present parents.
if (missing && missing.length > 0) {
this.logger.debug(
'Transaction %s was double-orphaned in mempool.',
tx.txid());
this.removeOrphan(tx.hash('hex'));
continue;
}
this.logger.debug('Resolved orphan %s in mempool.', tx.txid());
}