From e7539f864984740b80efc44e1a8970f4353ff066 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 1 Aug 2017 17:02:10 -0400 Subject: [PATCH] Fix some broken init-time prints/constants --- src/init.cpp | 5 +++-- src/test/test_bitcoin.cpp | 2 +- src/validation.cpp | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index ae84e49cd8e..ca62d3e7cc3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1440,8 +1440,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } // At this point blocktree args are consistent with what's on disk. - // If we're not mid-reindex (based on disk + args), add a genesis block on disk. - // This is called again in ThreadImport in the reindex completes. + // If we're not mid-reindex (based on disk + args), add a genesis block on disk + // (otherwise we use the one already on disk). + // This is called again in ThreadImport after the reindex completes. if (!fReindex && !LoadGenesisBlock(chainparams)) { strLoadError = _("Error initializing block database"); break; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 545e56983c3..e2e0a9668fd 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -75,7 +75,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha pcoinsdbview = new CCoinsViewDB(1 << 23, true); pcoinsTip = new CCoinsViewCache(pcoinsdbview); if (!LoadGenesisBlock(chainparams)) { - throw std::runtime_error("InitBlockIndex failed."); + throw std::runtime_error("LoadGenesisBlock failed."); } { CValidationState state; diff --git a/src/validation.cpp b/src/validation.cpp index babf6f15221..405ff356f50 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3916,7 +3916,6 @@ bool LoadGenesisBlock(const CChainParams& chainparams) if (mapBlockIndex.count(chainparams.GenesisBlock().GetHash())) return true; - // Only add the genesis block if not reindexing (in which case we reuse the one already on disk) try { CBlock &block = const_cast(chainparams.GenesisBlock()); // Start new block file