diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2020-03-05 15:58:30 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2020-09-18 09:37:57 +0900 |
commit | e8990f121405af8cd539b904ef082439261e6c93 (patch) | |
tree | 894930d7f74f876800c1073af5930d1c0e68b71c /src/util/system.cpp | |
parent | 404682b7cdb54494e7c98f0ba0cac8b51f379750 (diff) |
add signet chain and accompanying parameters
Co-authored-by: Anthony Towns <aj@erisian.com.au>
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 00aa53df70..6c7903044a 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -263,6 +263,7 @@ const std::list<SectionInfo> ArgsManager::GetUnrecognizedSections() const // Section names to be recognized in the config file. static const std::set<std::string> available_sections{ CBaseChainParams::REGTEST, + CBaseChainParams::SIGNET, CBaseChainParams::TESTNET, CBaseChainParams::MAIN }; @@ -916,16 +917,21 @@ std::string ArgsManager::GetChainName() const }; const bool fRegTest = get_net("-regtest"); + const bool fSigNet = get_net("-signet"); const bool fTestNet = get_net("-testnet"); const bool is_chain_arg_set = IsArgSet("-chain"); - if ((int)is_chain_arg_set + (int)fRegTest + (int)fTestNet > 1) { - throw std::runtime_error("Invalid combination of -regtest, -testnet and -chain. Can use at most one."); + if ((int)is_chain_arg_set + (int)fRegTest + (int)fSigNet + (int)fTestNet > 1) { + throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet and -chain. Can use at most one."); } if (fRegTest) return CBaseChainParams::REGTEST; + if (fSigNet) { + return CBaseChainParams::SIGNET; + } if (fTestNet) return CBaseChainParams::TESTNET; + return GetArg("-chain", CBaseChainParams::MAIN); } |