New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validation: add missing insert to m_dirty_blockindex #27905
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
...in FindMostWorkChain(). Before this, it was possible that the change to the block index wouldn't be persisted to disk.
1f33a84
to
e639364
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e639364
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e639364
Couldn't find any other instances of CBlockIndex::nStatus
updates not being added to m_dirty_blockindex
. As pointed out by mzumsande, I think indeed this should be corrected nicely upon startup since LoadBlockIndex()
iterates from start->end, as opposed to the reverse end->start being done here.
…ndex apply to BLOCK_CONFLICT_CHAINLOCK state as well
Should we make |
...in FindMostWorkChain(). Before this, it was possible that the change to the block index wouldn't be persisted to disk. Github-Pull: bitcoin#27905 Rebased-From: e639364
Would be nice if we didn't have to remember, I think there would be a few complications:
|
When the status of a block index is changed, we must add it to
m_dirty_blockindex
or the change might not get persisted to disk.This is missing from one spot in
FindMostWorkChain()
, whereBLOCK_FAILED_CHILD
is set.Since we have code that later sets missing
BLOCK_FAILED_CHILD
during the next startup, I don't think that this can lead to bad block indexes in practice, but I still think it's worth fixing.