diff options
| author | Jonas Schnelli <[email protected]> | 2018-04-08 16:24:22 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2018-04-08 16:24:30 +0200 |
| commit | 25c56cdbe748ec72c1d101c74602cca6bc82eee6 (patch) | |
| tree | b82e1ea7836b97fed845796a2034ecbd11b6361c /src/chainparamsbase.cpp | |
| parent | Merge #12901: build: Show enabled sanitizers in configure output (diff) | |
| parent | [tests] Add additional unit tests for -nofoo edge cases (diff) | |
| download | discoin-25c56cdbe748ec72c1d101c74602cca6bc82eee6.tar.xz discoin-25c56cdbe748ec72c1d101c74602cca6bc82eee6.zip | |
Merge #12878: [refactor] Config handling refactoring in preparation for network-specific sections
77a733a99 [tests] Add additional unit tests for -nofoo edge cases (Anthony Towns)
af173c2be [tests] Check GetChainName works with config entries (Anthony Towns)
fa27f1c23 [tests] Add unit tests for ReadConfigStream (Anthony Towns)
087c5d204 ReadConfigStream: assume the stream is good (Anthony Towns)
6d5815aad Separate out ReadConfigStream from ReadConfigFile (Anthony Towns)
834d30341 [tests] Add unit tests for GetChainName (Anthony Towns)
11b6b5b86 Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName (Anthony Towns)
Pull request description:
This does a bit of refactoring of the configuration handling code in order to add additional tests to make adding support for [test]/[regtest] sections in the config file in #11862 easier. Should not cause any behaviour changes.
Tree-SHA512: 8d2ce1449fc180de03414e7e569d1a21ba1e9f6564e13d3faf3961f710adc725fa0d4ab49b89ebd2baa11ea36ac5018377f693a84037d386a8b8697c9d6db3e9
Diffstat (limited to 'src/chainparamsbase.cpp')
| -rw-r--r-- | src/chainparamsbase.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 726616e65..c51a3fc96 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -49,17 +49,3 @@ void SelectBaseParams(const std::string& chain) { globalChainBaseParams = CreateBaseChainParams(chain); } - -std::string ChainNameFromCommandLine() -{ - bool fRegTest = gArgs.GetBoolArg("-regtest", false); - bool fTestNet = gArgs.GetBoolArg("-testnet", false); - - if (fTestNet && fRegTest) - throw std::runtime_error("Invalid combination of -regtest and -testnet."); - if (fRegTest) - return CBaseChainParams::REGTEST; - if (fTestNet) - return CBaseChainParams::TESTNET; - return CBaseChainParams::MAIN; -} |