aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-10 14:29:16 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-10 15:07:58 +0200
commitf23869e14bf7710f05f128544f2778dde28a01b7 (patch)
treeb0e93e2202c1126484189c9f8400b4faba41c5d1 /src/chainparams.cpp
parentfd1caa0961d9a5ceef0b8b232f278c9c27605d63 (diff)
parente84843c0dbb9cb853b912c09858b01c5c9302b09 (diff)
Merge pull request #4623
e84843c Broken addresses on command line no longer trigger testnet. (Ross Nicoll)
Diffstat (limited to 'src/chainparams.cpp')
-rw-r--r--src/chainparams.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index 460fabc6e6..179db5a818 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -221,24 +221,25 @@ const CChainParams &Params() {
return *pCurrentParams;
}
-void SelectParams(CBaseChainParams::Network network) {
- SelectBaseParams(network);
+CChainParams &Params(CBaseChainParams::Network network) {
switch (network) {
case CBaseChainParams::MAIN:
- pCurrentParams = &mainParams;
- break;
+ return mainParams;
case CBaseChainParams::TESTNET:
- pCurrentParams = &testNetParams;
- break;
+ return testNetParams;
case CBaseChainParams::REGTEST:
- pCurrentParams = &regTestParams;
- break;
+ return regTestParams;
default:
assert(false && "Unimplemented network");
- return;
+ return mainParams;
}
}
+void SelectParams(CBaseChainParams::Network network) {
+ SelectBaseParams(network);
+ pCurrentParams = &Params(network);
+}
+
bool SelectParamsFromCommandLine() {
if (!SelectBaseParamsFromCommandLine())
return false;