aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKarl-Johan Alm <[email protected]>2020-03-05 15:58:30 +0900
committerKarl-Johan Alm <[email protected]>2020-09-18 09:37:57 +0900
commite8990f121405af8cd539b904ef082439261e6c93 (patch)
tree894930d7f74f876800c1073af5930d1c0e68b71c /src/util
parentadd signet basic support (signet.cpp) (diff)
downloaddiscoin-e8990f121405af8cd539b904ef082439261e6c93.tar.xz
discoin-e8990f121405af8cd539b904ef082439261e6c93.zip
add signet chain and accompanying parameters
Co-authored-by: Anthony Towns <[email protected]>
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 00aa53df7..6c7903044 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);
}