Co-authored-by: Andrew Chow <achow101-github@achow101.com>
Backport of Core PR16528 [36/43] : https://github.com/bitcoin/bitcoin/pull/16528/commits/f193ea889ddb53d9a5c47647966681d525e38368
Add the wallet_util changes from [[https://github.com/bitcoin/bitcoin/pull/16528/commits/223588b1bbc63dc57098bbd0baa48635e0cc0b82 | 223588b]] because the patch is broken without it.