Repository navigation
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
stickies-v
left a comment
There was a problem hiding this comment.
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.
|
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_blockindexor the change might not get persisted to disk.This is missing from one spot in
FindMostWorkChain(), whereBLOCK_FAILED_CHILDis set.Since we have code that later sets missing
BLOCK_FAILED_CHILDduring 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.