mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 21:04:58 +02:00
add signet chain and accompanying parameters
Co-authored-by: Anthony Towns <aj@erisian.com.au>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user