Skip to content

Commit

Permalink
chore: sync chainstate loading logic with upstream
Browse files Browse the repository at this point in the history
Match formatting with what upcoming commits expect to limit conflicts
  • Loading branch information
kwvg committed Dec 15, 2024
1 parent e2095bd commit 620146b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1869,9 +1869,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
uiInterface.InitMessage(_("Loading block index…").translated);

do {
bool failed_verification = false;
const auto load_block_index_start_time{SteadyClock::now()};

try {
LOCK(cs_main);

Expand Down Expand Up @@ -1997,6 +1995,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// block tree into BlockIndex()!

bool failed_chainstate_init = false;

for (CChainState* chainstate : chainman.GetAll()) {
chainstate->InitCoinsDB(
/* cache_size_bytes */ nCoinDBCache,
Expand Down Expand Up @@ -2065,6 +2064,16 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
strLoadError = _("Error upgrading evo database for EHF");
break;
}
} catch (const std::exception& e) {
LogPrintf("%s\n", e.what());
strLoadError = _("Error opening block database");
break;
}

bool failed_verification = false;

try {
LOCK(cs_main);

for (CChainState* chainstate : chainman.GetAll()) {
if (!is_coinsview_empty(chainstate)) {
Expand Down

0 comments on commit 620146b

Please sign in to comment.