Pass mempool pointer to UnloadBlockIndex
Summary:
PR description:
Instead of relying on the implicit mempool global, pass a mempool pointer (which can be 0). This helps with testing, code clarity and unlocks the features described in #19556
This is a backport of core#19604 [2/3]
https://github.com/bitcoin/bitcoin/pull/19604/commits/fac674db200e6b2d5b32069335fb24e713d7b69f
Depends on D9756
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Subscribers: majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9757