aboutsummaryrefslogtreecommitdiff
path: root/src/chainparamsbase.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2015-06-27 19:21:41 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2015-12-01 10:18:18 +0000
commit02354c93bed8d556b8c9075e3ca8601c43c68267 (patch)
tree4007df50f0f8b07e068ed6751b2c84bc512ad0b1 /src/chainparamsbase.cpp
parent6abf6eb7bb777a5c4f22e9db6d4544281277378f (diff)
Constrain rpcport default values to a single location in code
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);