MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ChainTypeFromString

Function ChainTypeFromString

src/util/chaintype.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::optional<ChainType> ChainTypeFromString(std::string_view chain)
30{
31 if (chain == "main") {
32 return ChainType::MAIN;
33 } else if (chain == "test") {
34 return ChainType::TESTNET;
35 } else if (chain == "testnet4") {
36 return ChainType::TESTNET4;
37 } else if (chain == "signet") {
38 return ChainType::SIGNET;
39 } else if (chain == "regtest") {
40 return ChainType::REGTEST;
41 } else {
42 return std::nullopt;
43 }
44}

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.85
GetChainArgMethod · 0.85

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68