diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index aae2755a..04cb55cd 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -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()); }