Previous discussion https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340307903
---
https://github.com/bitcoin/bitcoin/pull/17381/commits/491a599b37f3e3a648e52aebed677ca11b0615e2
Depends on D7417
Partial backport of Core [[https://github.com/bitcoin/bitcoin/pull/17381 | PR17381]]