Page MenuHomePhabricator

Optimize `removeForBlock`
Open, Needs TriagePublic

Description

The following commit was introduced to fix a bug with ancestor and descendant handling when removing transactions from the mempool after accepting a new block.

https://reviews.bitcoinabc.org/D1686

The method of to fix this was to resort the block transactions into topological order before removing them. However, this is quite slow, and adds 1.5 hours to IBD.

We should optimize this process as much as possible, or fix the underlying root cause (how the mempool tracks transaction chain stats)