Browse Source

Fix some broken init-time prints/constants

0.15
Matt Corallo 8 years ago
parent
commit
e7539f8649
  1. 5
      src/init.cpp
  2. 2
      src/test/test_bitcoin.cpp
  3. 1
      src/validation.cpp

5
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. // 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. // 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. // (otherwise we use the one already on disk).
// This is called again in ThreadImport after the reindex completes.
if (!fReindex && !LoadGenesisBlock(chainparams)) { if (!fReindex && !LoadGenesisBlock(chainparams)) {
strLoadError = _("Error initializing block database"); strLoadError = _("Error initializing block database");
break; break;

2
src/test/test_bitcoin.cpp

@ -75,7 +75,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
pcoinsdbview = new CCoinsViewDB(1 << 23, true); pcoinsdbview = new CCoinsViewDB(1 << 23, true);
pcoinsTip = new CCoinsViewCache(pcoinsdbview); pcoinsTip = new CCoinsViewCache(pcoinsdbview);
if (!LoadGenesisBlock(chainparams)) { if (!LoadGenesisBlock(chainparams)) {
throw std::runtime_error("InitBlockIndex failed."); throw std::runtime_error("LoadGenesisBlock failed.");
} }
{ {
CValidationState state; CValidationState state;

1
src/validation.cpp

@ -3916,7 +3916,6 @@ bool LoadGenesisBlock(const CChainParams& chainparams)
if (mapBlockIndex.count(chainparams.GenesisBlock().GetHash())) if (mapBlockIndex.count(chainparams.GenesisBlock().GetHash()))
return true; return true;
// Only add the genesis block if not reindexing (in which case we reuse the one already on disk)
try { try {
CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock()); CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock());
// Start new block file // Start new block file

Loading…
Cancel
Save