[[https://github.com/bitcoin/bitcoin/pull/15321/files | PR15321]] backport, aside from one minor change which will be noticed
when the backport in question happens later on ( [[https://github.com/bitcoin/bitcoin/pull/14957/files | PR14957]] ).
Depends on D5237