Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mempool: fix orphan resolution edge case.
  • Loading branch information
chjj committed Sep 27, 2017
1 parent 1aa78e2 commit ca4e938
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/mempool/mempool.js
Expand Up @@ -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());
}
Expand Down

0 comments on commit ca4e938

Please sign in to comment.