Skip to content

Commit 620146b

Browse files
committed
chore: sync chainstate loading logic with upstream
Match formatting with what upcoming commits expect to limit conflicts
1 parent e2095bd commit 620146b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/init.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,9 +1869,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
18691869
uiInterface.InitMessage(_("Loading block index…").translated);
18701870

18711871
do {
1872-
bool failed_verification = false;
18731872
const auto load_block_index_start_time{SteadyClock::now()};
1874-
18751873
try {
18761874
LOCK(cs_main);
18771875

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

19991997
bool failed_chainstate_init = false;
1998+
20001999
for (CChainState* chainstate : chainman.GetAll()) {
20012000
chainstate->InitCoinsDB(
20022001
/* cache_size_bytes */ nCoinDBCache,
@@ -2065,6 +2064,16 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
20652064
strLoadError = _("Error upgrading evo database for EHF");
20662065
break;
20672066
}
2067+
} catch (const std::exception& e) {
2068+
LogPrintf("%s\n", e.what());
2069+
strLoadError = _("Error opening block database");
2070+
break;
2071+
}
2072+
2073+
bool failed_verification = false;
2074+
2075+
try {
2076+
LOCK(cs_main);
20682077

20692078
for (CChainState* chainstate : chainman.GetAll()) {
20702079
if (!is_coinsview_empty(chainstate)) {

0 commit comments

Comments
 (0)