Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
This concludes backport of [[https://github.com/bitcoin/bitcoin/pull/24141 | core#24141]]
https://github.com/bitcoin/bitcoin/pull/24141/commits/e71c51b27d420fbd6cc0a36f62e63e190e13473a
Depends on D18252