diff options
| author | Anthony Towns <[email protected]> | 2018-03-29 15:00:00 +1000 |
|---|---|---|
| committer | Anthony Towns <[email protected]> | 2018-04-06 04:46:02 +1000 |
| commit | 11b6b5b86e7dab05be38d614891dd6e6031d04a4 (patch) | |
| tree | 3401eabbf1991c95c811a03984f8015429e39b0b /src/util.cpp | |
| parent | Merge #10244: Refactor: separate gui from wallet and node (diff) | |
| download | discoin-11b6b5b86e7dab05be38d614891dd6e6031d04a4.tar.xz discoin-11b6b5b86e7dab05be38d614891dd6e6031d04a4.zip | |
Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index 46054f502..6dfb12f8e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -764,6 +764,20 @@ void ArgsManager::ReadConfigFile(const std::string& confPath) } } +std::string ArgsManager::GetChainName() const +{ + bool fRegTest = GetBoolArg("-regtest", false); + bool fTestNet = 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; +} + #ifndef WIN32 fs::path GetPidFile() { |