> It seems preferable to assign globals to a class (in this case BlockManager), than to leave them dangling. This should clarify scope for code-readers, as well as clarifying unit test behaviour.
This is a partial backport of core#25781
https://github.com/bitcoin/bitcoin/pull/25781/commits/fa721f1cab0de239a93f6bf70e3a8af26fddae8a
Depends on D16006