Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,233 Lines • ▼ Show 20 Lines | while (!fLoaded && !ShutdownRequested()) { | ||||
// block | // block | ||||
if (!LoadChainTip(config)) { | if (!LoadChainTip(config)) { | ||||
strLoadError = _("Error initializing block database"); | strLoadError = _("Error initializing block database"); | ||||
break; | break; | ||||
} | } | ||||
assert(chainActive.Tip() != nullptr); | assert(chainActive.Tip() != nullptr); | ||||
} | } | ||||
if (!fReset) { | |||||
// 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(config)) { | |||||
strLoadError = _("Unable to rewind the database to a " | |||||
"pre-fork state. You will need to " | |||||
"redownload the blockchain"); | |||||
break; | |||||
} | |||||
} | |||||
if (!is_coinsview_empty) { | if (!is_coinsview_empty) { | ||||
uiInterface.InitMessage(_("Verifying blocks...")); | uiInterface.InitMessage(_("Verifying blocks...")); | ||||
if (fHavePruned && | if (fHavePruned && | ||||
gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > | gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > | ||||
MIN_BLOCKS_TO_KEEP) { | MIN_BLOCKS_TO_KEEP) { | ||||
LogPrintf( | LogPrintf( | ||||
"Prune: pruned datadir may not have more than %d " | "Prune: pruned datadir may not have more than %d " | ||||
"blocks; only checking available blocks\n", | "blocks; only checking available blocks\n", | ||||
▲ Show 20 Lines • Show All 250 Lines • Show Last 20 Lines |