aboutsummaryrefslogtreecommitdiff
path: root/src/chainparamsbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chainparamsbase.cpp')
-rw-r--r--src/chainparamsbase.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp
index db2dc751f5..aa973abf7e 100644
--- a/src/chainparamsbase.cpp
+++ b/src/chainparamsbase.cpp
@@ -86,18 +86,23 @@ const CBaseChainParams& BaseParams()
return *pCurrentBaseParams;
}
-void SelectBaseParams(const std::string& chain)
+CBaseChainParams& BaseParams(const std::string& chain)
{
if (chain == CBaseChainParams::MAIN)
- pCurrentBaseParams = &mainParams;
+ return mainParams;
else if (chain == CBaseChainParams::TESTNET)
- pCurrentBaseParams = &testNetParams;
+ return testNetParams;
else if (chain == CBaseChainParams::REGTEST)
- pCurrentBaseParams = &regTestParams;
+ return regTestParams;
else
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
}
+void SelectBaseParams(const std::string& chain)
+{
+ pCurrentBaseParams = &BaseParams(chain);
+}
+
std::string ChainNameFromCommandLine()
{
bool fRegTest = GetBoolArg("-regtest", false);