Skip to content

Commit

Permalink
Move init logistics message for BAD_GENESIS_BLOCK to init.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Dec 16, 2024
1 parent 29c7362 commit 2ea1bbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
strLoadError = _("Error loading block database");
break;
case ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK:
// If the loaded chain has a wrong genesis, bail out immediately
// (we're likely using a testnet datadir, or the other way around).
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
case ChainstateLoadingError::ERROR_BAD_DEVNET_GENESIS_BLOCK:
return InitError(_("Incorrect or no devnet genesis block found. Wrong datadir for devnet specified?"));
Expand Down
2 changes: 0 additions & 2 deletions src/node/chainstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
return ChainstateLoadingError::ERROR_TXINDEX_DISABLED_WHEN_GOV_ENABLED;
}

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

0 comments on commit 2ea1bbc

Please sign in to comment.