diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-17 08:47:11 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-17 08:47:11 +0200 |
commit | 494ff05a4cd9d89857342d5c843ed480afcc8fe7 (patch) | |
tree | dbab4f9ea8dfe172b9766b3df0b7cb87ea908b53 /src/chainparamsbase.cpp | |
parent | c2fc9729d15a6a9b1888ec03daef38cf1e2740a9 (diff) | |
parent | ca3ce0fa037a94f2c357ad04d42e5f526cbcb78e (diff) |
Merge pull request #4804 from jtimon/chainparams3
Remove CBaseChainParams::NetworkID()
Diffstat (limited to 'src/chainparamsbase.cpp')
-rw-r--r-- | src/chainparamsbase.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index e9d63197bd..5d9ec7927b 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -100,22 +100,27 @@ void SelectBaseParams(CBaseChainParams::Network network) } } -bool SelectBaseParamsFromCommandLine() +CBaseChainParams::Network NetworkIdFromCommandLine() { bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); - if (fTestNet && fRegTest) { + if (fTestNet && fRegTest) + return CBaseChainParams::MAX_NETWORK_TYPES; + if (fRegTest) + return CBaseChainParams::REGTEST; + if (fTestNet) + return CBaseChainParams::TESTNET; + return CBaseChainParams::MAIN; +} + +bool SelectBaseParamsFromCommandLine() +{ + CBaseChainParams::Network network = NetworkIdFromCommandLine(); + if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; - } - if (fRegTest) { - SelectBaseParams(CBaseChainParams::REGTEST); - } else if (fTestNet) { - SelectBaseParams(CBaseChainParams::TESTNET); - } else { - SelectBaseParams(CBaseChainParams::MAIN); - } + SelectBaseParams(network); return true; } |