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 [[https://github.com/bitcoin/bitcoin/pull/19556 | #19556]]
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19604 | core#19604]] [2/3]
https://github.com/bitcoin/bitcoin/pull/19604/commits/fac674db200e6b2d5b32069335fb24e713d7b69f
Depends on D9756