diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-04-15 12:02:06 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-04-15 12:06:55 +0200 |
commit | ea2b425b00b01b5b6670fa39488caf146dac4642 (patch) | |
tree | e2a551f60f1f8803907b2eff5b0daf5dff4d2969 /src/init.cpp | |
parent | 622e3c9c3965c06acd1071d587a7b5286afd1aa4 (diff) | |
parent | 4e382177eda203e799310350ffb2efc28d010799 (diff) |
Merge pull request #5997
4e38217 Chainparams: Refactor: Remove redundant HashGenesisBlock() getter (Jorge Timón)
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index eb3a3fe58b..4d9c233c8c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -602,6 +602,7 @@ bool AppInit2(boost::thread_group& threadGroup) #endif // ********************************************************* Step 2: parameter interactions + const CChainParams& chainparams = Params(); // Set this early so that parameter interactions go to console fPrintToConsole = GetBoolArg("-printtoconsole", false); @@ -694,8 +695,8 @@ bool AppInit2(boost::thread_group& threadGroup) InitWarning(_("Warning: Unsupported argument -benchmark ignored, use -debug=bench.")); // Checkmempool and checkblockindex default to true in regtest mode - mempool.setSanityCheck(GetBoolArg("-checkmempool", Params().DefaultConsistencyChecks())); - fCheckBlockIndex = GetBoolArg("-checkblockindex", Params().DefaultConsistencyChecks()); + mempool.setSanityCheck(GetBoolArg("-checkmempool", chainparams.DefaultConsistencyChecks())); + fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks()); Checkpoints::fEnabled = GetBoolArg("-checkpoints", true); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency @@ -1038,7 +1039,7 @@ bool AppInit2(boost::thread_group& threadGroup) // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). - if (!mapBlockIndex.empty() && mapBlockIndex.count(Params().HashGenesisBlock()) == 0) + if (!mapBlockIndex.empty() && mapBlockIndex.count(chainparams.GetConsensus().hashGenesisBlock) == 0) return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?")); // Initialize the block index (no-op if non-empty database was already loaded) |