Co-authored-by: Suhas Daftuar <sdaftuar@gmail.com>
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19724 | core#19724]] [4/109]
https://github.com/bitcoin/bitcoin/pull/19724/commits/ff6b9081add3a40d53b1cc1352b57eeb46e41d45
Depends on D9772