Pass chain and client variables where needed
Summary:
This commit does not change behavior. All it does is pass new function parameters.
Partial backport of core PR14437:
https://github.com/bitcoin/bitcoin/pull/14437/commits/8db11dd0b182a93042899651545cc21b34bf0742#diff-c0ec078346af03640b953e854ff6609a
Depends on D5064.
Test Plan:
ninja check bitcoin-bench
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5074