aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2015-04-09 15:58:34 +0200
committerJorge Timón <jtimon@jtimon.cc>2015-04-12 23:01:30 +0200
commit4e382177eda203e799310350ffb2efc28d010799 (patch)
treeee6c031f0f5f8fe1198228795ae36336cc7752f0 /src/init.cpp
parentc8a13501196fc79a3f728683b74f9d586dda46c1 (diff)
downloadbitcoin-4e382177eda203e799310350ffb2efc28d010799.tar.xz
Chainparams: Refactor: Remove redundant HashGenesisBlock() getter
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 53e521983f..0d98b2b92b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -607,6 +607,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);
@@ -699,8 +700,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
@@ -1043,7 +1044,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)