mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
More user-friendly error message if UTXO DB runs ahead of block DB
This gives LoadChainTip a return value - allowing it to indicate that the UTXO DB ran ahead of the block DB. This just provides a nicer error message instead of the previous mysterious assert(!setBlockIndexCandidates.empty()) error. This also calls ActivateBestChain in case we just loaded the genesis block in LoadChainTip, avoiding relying on the ActivateBestChain in ThreadImport before continuing init process.
This commit is contained in:
parent
eda888e573
commit
b0f32497b8
3 changed files with 24 additions and 5 deletions
10
src/init.cpp
10
src/init.cpp
|
|
@ -1442,7 +1442,15 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||
break;
|
||||
}
|
||||
pcoinsTip = new CCoinsViewCache(pcoinscatcher);
|
||||
LoadChainTip(chainparams);
|
||||
|
||||
if (!fReindex && !fReindexChainState) {
|
||||
// LoadChainTip sets chainActive based on pcoinsTip's best block
|
||||
if (!LoadChainTip(chainparams)) {
|
||||
strLoadError = _("Error initializing block database");
|
||||
break;
|
||||
}
|
||||
assert(chainActive.Tip() != NULL);
|
||||
}
|
||||
|
||||
if (!fReindex && chainActive.Tip() != NULL) {
|
||||
uiInterface.InitMessage(_("Rewinding blocks..."));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue