diff options
author | Ross Nicoll <jrn@jrn.me.uk> | 2014-08-02 19:54:57 +0100 |
---|---|---|
committer | Ross Nicoll <jrn@jrn.me.uk> | 2014-08-30 09:39:59 +0100 |
commit | e84843c0dbb9cb853b912c09858b01c5c9302b09 (patch) | |
tree | da59bc29ef10f63bc53ccba2e392c4979f37d353 /src/chainparams.cpp | |
parent | 9d26dc3b2973252cc4dbe0f46edb56bfcea1cb78 (diff) |
Broken addresses on command line no longer trigger testnet.
When passing a bitcoin: URI on the command line, invalid addresses do not incorrectly send the
user to the test network.
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; |