This is part 2 of 5 of the backport of Core PR17513
Depends on [[https://reviews.bitcoinabc.org/D7572 | D7572]]
Note: Unlike the [[https://github.com/bitcoin/bitcoin/pull/17513/commits/a53e9895db7617c879858ca27e38e6aaf35f6075 | original commit]], this diff does not remove a circular dependency
because of differences in the codebase (#IFDEF ENABLE_BIP70)