diff options
Diffstat (limited to 'src/chainparams.cpp')
-rw-r--r-- | src/chainparams.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f32d4ed235..84cfd11feb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -220,24 +220,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 = ®TestParams; - 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; |