Based on suggestions by MarcoFalke <falke.marco@gmail.com>
This concludes backport of [[https://github.com/bitcoin/bitcoin/pull/23413 | core#23413]]
https://github.com/bitcoin/bitcoin/pull/23413/commits/11daf6ceb1d9ea1f8d638b123eecfe39d162a7c3
Depends on D14768