and use it in blockstorage.cpp
This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/27570 | core#27570]]
https://github.com/bitcoin/bitcoin/pull/27570/commits/facdb8b331da17c10b122deb28f6d71d5797f063
(partial) https://github.com/bitcoin/bitcoin/pull/27570/commits/fa5d7c39eb992467e43b12db213b27913374fb83
Depends on D16010