aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2020-03-05 15:58:30 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2020-09-18 09:37:57 +0900
commite8990f121405af8cd539b904ef082439261e6c93 (patch)
tree894930d7f74f876800c1073af5930d1c0e68b71c /src/util
parent404682b7cdb54494e7c98f0ba0cac8b51f379750 (diff)
add signet chain and accompanying parameters
Co-authored-by: Anthony Towns <aj@erisian.com.au>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/system.cpp10
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);
}