note: the first commit
(https://github.com/bitcoin/bitcoin/pull/17154/commits/8bba91b22d22a8dfea7c947b542b1022bfc1c0ea) didn't really apply to us.
Depends on D7111
Partial backport of Core PR17154