refactoring: add a method for determining if a block is pruned or not
Summary:
"The check for whether a block is pruned or not is sufficiently obscure that it deserves a macro. It is also used in 2 places, with more coming, e.g. #10757 (turns out it was a move, not an addition)."
This is a backport from Core PR13259: https://github.com/bitcoin/bitcoin/pull/13259
Test Plan:
ninja check ./test/functional/test_runner.py
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix, nakihito, jasonbcox
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix, nakihito, jasonbcox
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4624