From 2ea1bbc7aa7ae8a7c97efe9f004a26e8bbb53b8b Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:20:44 -0500 Subject: [PATCH] Move init logistics message for BAD_GENESIS_BLOCK to init.cpp --- src/init.cpp | 2 ++ src/node/chainstate.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) 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;