chore: sync chainstate loading logic with upstream

Match formatting with what upcoming commits expect to limit conflicts
This commit is contained in:
Kittywhiskers Van Gogh 2024-10-03 06:28:12 +00:00
parent e2095bd68a
commit 620146bcb8
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -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);
@ -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,
@ -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)) {