diff --git a/src/init.cpp b/src/init.cpp index bd9fa4e499..0ae823a5fd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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?")); diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 96652513a9..0b81986ee4 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -128,8 +128,6 @@ std::optional 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;