pindexBestInvalid
from a global to become ChainstateManager.m_best_invalid
but dropped the explcit initalization to nullptr
. Replace that, and annotate it as guarded by cs_main
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Initialization is done by UnloadBlockIndex
for all code paths at least as of current master. Not calling UnloadBlockIndex
would be a bug, as it leaves some globals untouched, letting them point to potentially deleted memory.
So it looks like this is refactoring and not a bug fix or something that can be exploited?
ACK on the changes either way, I am just trying to figure out if this is a blocker for 23.0, as you tagged this for backport.
UnloadBlockIndex
gets removed in #22564. cc @dongcarl – maybe you want to just take ths into your PR
ajtowns
DrahtBot
MarcoFalke
dongcarl
Labels
Refactoring