diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-10 14:29:16 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-10 15:07:58 +0200 |
commit | f23869e14bf7710f05f128544f2778dde28a01b7 (patch) | |
tree | b0e93e2202c1126484189c9f8400b4faba41c5d1 /src/chainparams.cpp | |
parent | fd1caa0961d9a5ceef0b8b232f278c9c27605d63 (diff) | |
parent | e84843c0dbb9cb853b912c09858b01c5c9302b09 (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.cpp | 19 |
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 = ®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; |