diff options
author | Matt Corallo <git@bluematt.me> | 2017-07-06 21:29:46 -0400 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2017-07-27 15:03:05 -0400 |
commit | ff3a21919d97f7500978b4160199336e4b50b36a (patch) | |
tree | db20d70619278213b27694968fd6afd693334f93 /src/init.cpp | |
parent | b0f32497b873cd1eaf0be86f8e265355aa86174f (diff) |
Call RewindBlockIndex even if we're about to run -reindex-chainstate
RewindBlockIndex works over both chainActive - disconnecting blocks
from the tip that need witness verification - and mapBlockIndex -
requiring redownload of blocks missing witness data.
It should never have been the case that the second half is skipped
if we're about to run -reindex-chainstate.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8fec69c2b8..2ea778a5b1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1452,7 +1452,10 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) assert(chainActive.Tip() != NULL); } - if (!fReindex && chainActive.Tip() != NULL) { + if (!fReindex) { + // Note that RewindBlockIndex MUST run even if we're about to -reindex-chainstate. + // It both disconnects blocks based on chainActive, and drops block data in + // mapBlockIndex based on lack of available witness data. uiInterface.InitMessage(_("Rewinding blocks...")); if (!RewindBlockIndex(chainparams)) { strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain"); |