co-authored-by: Glenn Willen <gwillen@nerdnet.org>
Backport of Core [[https://github.com/bitcoin/bitcoin/pull/17509 | PR17509]] part [6/6] : https://github.com/bitcoin/bitcoin/pull/17509/commits/1cd8dc2556b847e11a238b9e69493cd8fbeecc6c
Depends on D8065, D8070, D8068 and D8069