mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
Move init logistics message for BAD_GENESIS_BLOCK to init.cpp
This commit is contained in:
parent
8715658983
commit
975235ca0a
@ -1436,6 +1436,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
strLoadError = _("Error loading block database");
|
strLoadError = _("Error loading block database");
|
||||||
break;
|
break;
|
||||||
case ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK:
|
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?"));
|
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
|
||||||
case ChainstateLoadingError::ERROR_PRUNED_NEEDS_REINDEX:
|
case ChainstateLoadingError::ERROR_PRUNED_NEEDS_REINDEX:
|
||||||
strLoadError = _("You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain");
|
strLoadError = _("You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain");
|
||||||
|
@ -61,8 +61,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
|
|||||||
return ChainstateLoadingError::ERROR_LOADING_BLOCK_DB;
|
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() &&
|
if (!chainman.BlockIndex().empty() &&
|
||||||
!chainman.m_blockman.LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
|
!chainman.m_blockman.LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
|
||||||
return ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK;
|
return ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user