mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 18:09:47 +01:00
Merge bitcoin/bitcoin#30625: chainparams: Handle Testnet4 in GetNetworkForMagic
b0ec8716bf
chainparams: Handle Testnet4 in GetNetworkForMagic (Fabian Jahr) Pull request description: Found during testing: The recently introduced `GetNetworkForMagic()` doesn't handle Testnet4 yet. ACKs for top commit: tdb3: cr ACKb0ec8716bf
maflcko: review ACKb0ec8716bf
theStack: ACKb0ec8716bf
willcl-ark: crACKb0ec8716bf
Tree-SHA512: 77cd0a6791529e5c5dfdb25cff3eff77224be9058d7cf4a8b3544651eb44c5e8ee90c5abfb9751ab0e11c5aa2d8477831dbf1868c4d5909481e0979e4db1eb28
This commit is contained in:
commit
c7b8f6f2e2
@ -685,6 +685,7 @@ std::optional<ChainType> GetNetworkForMagic(const MessageStartChars& message)
|
||||
{
|
||||
const auto mainnet_msg = CChainParams::Main()->MessageStart();
|
||||
const auto testnet_msg = CChainParams::TestNet()->MessageStart();
|
||||
const auto testnet4_msg = CChainParams::TestNet4()->MessageStart();
|
||||
const auto regtest_msg = CChainParams::RegTest({})->MessageStart();
|
||||
const auto signet_msg = CChainParams::SigNet({})->MessageStart();
|
||||
|
||||
@ -692,6 +693,8 @@ std::optional<ChainType> GetNetworkForMagic(const MessageStartChars& message)
|
||||
return ChainType::MAIN;
|
||||
} else if (std::equal(message.begin(), message.end(), testnet_msg.data())) {
|
||||
return ChainType::TESTNET;
|
||||
} else if (std::equal(message.begin(), message.end(), testnet4_msg.data())) {
|
||||
return ChainType::TESTNET4;
|
||||
} else if (std::equal(message.begin(), message.end(), regtest_msg.data())) {
|
||||
return ChainType::REGTEST;
|
||||
} else if (std::equal(message.begin(), message.end(), signet_msg.data())) {
|
||||
|
Loading…
Reference in New Issue
Block a user