Skip to content

Commit 2ea1bbc

Browse files
committed
Move init logistics message for BAD_GENESIS_BLOCK to init.cpp
1 parent 29c7362 commit 2ea1bbc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
19011901
strLoadError = _("Error loading block database");
19021902
break;
19031903
case ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK:
1904+
// If the loaded chain has a wrong genesis, bail out immediately
1905+
// (we're likely using a testnet datadir, or the other way around).
19041906
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
19051907
case ChainstateLoadingError::ERROR_BAD_DEVNET_GENESIS_BLOCK:
19061908
return InitError(_("Incorrect or no devnet genesis block found. Wrong datadir for devnet specified?"));

src/node/chainstate.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
128128
return ChainstateLoadingError::ERROR_TXINDEX_DISABLED_WHEN_GOV_ENABLED;
129129
}
130130

131-
// If the loaded chain has a wrong genesis, bail out immediately
132-
// (we're likely using a testnet datadir, or the other way around).
133131
if (!chainman.BlockIndex().empty() &&
134132
!chainman.m_blockman.LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
135133
return ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK;

0 commit comments

Comments
 (0)