Skip to content

Commit 975235c

Browse files
committed
Move init logistics message for BAD_GENESIS_BLOCK to init.cpp
1 parent 8715658 commit 975235c

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
@@ -1436,6 +1436,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14361436
strLoadError = _("Error loading block database");
14371437
break;
14381438
case ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK:
1439+
// If the loaded chain has a wrong genesis, bail out immediately
1440+
// (we're likely using a testnet datadir, or the other way around).
14391441
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
14401442
case ChainstateLoadingError::ERROR_PRUNED_NEEDS_REINDEX:
14411443
strLoadError = _("You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain");

src/node/chainstate.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
6161
return ChainstateLoadingError::ERROR_LOADING_BLOCK_DB;
6262
}
6363

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

0 commit comments

Comments
 (0)