mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 20:20:00 +01:00
testnet: Introduce Testnet4
This commit is contained in:
@@ -159,6 +159,7 @@ std::list<SectionInfo> ArgsManager::GetUnrecognizedSections() const
|
||||
ChainTypeToString(ChainType::REGTEST),
|
||||
ChainTypeToString(ChainType::SIGNET),
|
||||
ChainTypeToString(ChainType::TESTNET),
|
||||
ChainTypeToString(ChainType::TESTNET4),
|
||||
ChainTypeToString(ChainType::MAIN),
|
||||
};
|
||||
|
||||
@@ -773,10 +774,11 @@ std::variant<ChainType, std::string> ArgsManager::GetChainArg() const
|
||||
const bool fRegTest = get_net("-regtest");
|
||||
const bool fSigNet = get_net("-signet");
|
||||
const bool fTestNet = get_net("-testnet");
|
||||
const bool fTestNet4 = get_net("-testnet4");
|
||||
const auto chain_arg = GetArg("-chain");
|
||||
|
||||
if ((int)chain_arg.has_value() + (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 ((int)chain_arg.has_value() + (int)fRegTest + (int)fSigNet + (int)fTestNet + (int)fTestNet4 > 1) {
|
||||
throw std::runtime_error("Invalid combination of -regtest, -signet, -testnet, -testnet4 and -chain. Can use at most one.");
|
||||
}
|
||||
if (chain_arg) {
|
||||
if (auto parsed = ChainTypeFromString(*chain_arg)) return *parsed;
|
||||
@@ -786,6 +788,7 @@ std::variant<ChainType, std::string> ArgsManager::GetChainArg() const
|
||||
if (fRegTest) return ChainType::REGTEST;
|
||||
if (fSigNet) return ChainType::SIGNET;
|
||||
if (fTestNet) return ChainType::TESTNET;
|
||||
if (fTestNet4) return ChainType::TESTNET4;
|
||||
return ChainType::MAIN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user