diff --git a/src/init.cpp b/src/init.cpp index 06af88dccd..bad7acd391 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2481,6 +2481,9 @@ bool AppInitMain(Config &config, RPCServer &rpcServer, 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_PRUNED_NEEDS_REINDEX: diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 36dcc478bc..da36bac91e 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -76,8 +76,6 @@ LoadChainstate(bool fReset, ChainstateManager &chainman, CTxMemPool *mempool, return ChainstateLoadingError::ERROR_LOADING_BLOCK_DB; } - // 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)) {