aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.cpp
diff options
context:
space:
mode:
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;