This repository was archived by the owner on Oct 28, 2021. It is now read-only.
Write database minor version to disk and fix rebuild on minor version mismatch bug#5827
Merged
halfalicious merged 2 commits intomasterfrom Nov 16, 2019
Merged
Write database minor version to disk and fix rebuild on minor version mismatch bug#5827halfalicious merged 2 commits intomasterfrom
halfalicious merged 2 commits intomasterfrom
Conversation
bd53953 to
6472149
Compare
gumb0
reviewed
Nov 15, 2019
| } | ||
|
|
||
| if (_we != WithExisting::Verify && !details(m_genesisHash)) | ||
| if (_we != WithExisting::Verify && !rebuildNeeded && !details(m_genesisHash)) |
Member
There was a problem hiding this comment.
If do this insertion here in case rebuildNeeded == true, maybe then we don't need to duplicate this code in rebuild ?
Member
There was a problem hiding this comment.
Ah I see, rebuild will first rename this database anyway
gumb0
approved these changes
Nov 15, 2019
Rebuild is triggered on db minorversion mismatch, but BlockChain::open removes the extras database so rebuild won't find any blocks to reimport. Address this by not removing the extras database on minorversion mismatch.
6472149 to
038a75f
Compare
Codecov Report
@@ Coverage Diff @@
## master #5827 +/- ##
=========================================
Coverage ? 64.08%
=========================================
Files ? 360
Lines ? 30898
Branches ? 3427
=========================================
Hits ? 19800
Misses ? 9870
Partials ? 1228 |
Contributor
Author
|
Rebased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #5822, #5813
Built ontop of #5826 so will wait to merge this until that has been merged.
This PR fixes two bugs:
BlockChain::openpopulates this after renaming extras -> extras.old so since it can't find the "best" block in the extras DB it just uses the genesis hash.