As per title
This is a partial backport of [[https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/merge_requests/1820 | bchn#1820]]
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=c10b3f01fcf8616c59bf2ddebed9b875f071cd72