diff options
author | jtimon <jtimon@blockstream.io> | 2014-10-09 19:15:38 +0200 |
---|---|---|
committer | jtimon <jtimon@blockstream.io> | 2014-10-10 12:05:20 +0200 |
commit | b796cb084bd3865d094d86da2f33cd5c68294a43 (patch) | |
tree | 41ade1a991db35b37d753a79010e655cf67ed85c | |
parent | 3fdb9e8c159a2bc3ac853b469dae9ba0ecf739f3 (diff) |
SQUASHME: NetworkIdFromCommandLine() function instead of method
-rw-r--r-- | src/chainparams.cpp | 2 | ||||
-rw-r--r-- | src/chainparamsbase.cpp | 12 | ||||
-rw-r--r-- | src/chainparamsbase.h | 13 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f561877d9f..ec05f592b9 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -242,7 +242,7 @@ void SelectParams(CBaseChainParams::Network network) { bool SelectParamsFromCommandLine() { - CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 05ef5dd463..f275bd544f 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -83,23 +83,23 @@ void SelectBaseParams(CBaseChainParams::Network network) } } -CBaseChainParams::Network CBaseChainParams::NetworkIdFromCommandLine() +CBaseChainParams::Network NetworkIdFromCommandLine() { bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); if (fTestNet && fRegTest) - return MAX_NETWORK_TYPES; + return CBaseChainParams::MAX_NETWORK_TYPES; if (fRegTest) - return REGTEST; + return CBaseChainParams::REGTEST; if (fTestNet) - return TESTNET; - return MAIN; + return CBaseChainParams::TESTNET; + return CBaseChainParams::MAIN; } bool SelectBaseParamsFromCommandLine() { - CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index f24337cef0..ff3e811988 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -26,11 +26,6 @@ public: const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } - /** - * Looks for -regtest or -testnet and returns the appropriate Network ID. - * Returns MAX_NETWORK_TYPES if an invalid combination is given. - */ - static Network NetworkIdFromCommandLine(); protected: CBaseChainParams() {} @@ -49,7 +44,13 @@ const CBaseChainParams& BaseParams(); void SelectBaseParams(CBaseChainParams::Network network); /** - * Calls CBaseChainParams::NetworkIdFromCommandLine() and then calls SelectParams as appropriate. + * Looks for -regtest or -testnet and returns the appropriate Network ID. + * Returns MAX_NETWORK_TYPES if an invalid combination is given. + */ +CBaseChainParams::Network NetworkIdFromCommandLine(); + +/** + * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate. * Returns false if an invalid combination is given. */ bool SelectBaseParamsFromCommandLine(); |