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.