The mempool janitor (“poolman”) is a thread that runs every -janitorinterval seconds. The janitor scans and removes memory pool transactions older than current time minus -janitorexpire seconds.
By default, janitor runs every 24 hrs, expiring TXs older than 72 hrs [and have failed to make it into a block in that time].
IsMine() transactions are not touched.
This is intentionally crude: easily reviewed, reasoned and tested; fitting easily within the current framework, or being backported to an older bitcoind. A key goal was not rewriting mempool.
Comments:
- One alternative implementation was considered:
0 while (mempool byte size > limit)
1 expire oldest !ismine
This would work, but require a sort step, as mempool is not time-ordered. There is also the question of how often to run such a while{} loop, likely leading to some sort of high-water/low-water system.
The sweep implementation presented seemed more straightforward.