mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Remove header checks out of net_processing
This moves header size and netmagic checking out of net_processing and into net. This check now runs in ReadHeader, so that net can exit early out of receiving bytes from the peer. IsValid is now slimmed down, so it no longer needs a MessageStartChars& parameter. Additionally this removes the rest of the m_valid_* members from CNetMessage.
This commit is contained in:
@@ -189,10 +189,9 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||
DeserializeFromFuzzingInput(buffer, s);
|
||||
AssertEqualAfterSerializeDeserialize(s);
|
||||
#elif MESSAGEHEADER_DESERIALIZE
|
||||
const CMessageHeader::MessageStartChars pchMessageStart = {0x00, 0x00, 0x00, 0x00};
|
||||
CMessageHeader mh;
|
||||
DeserializeFromFuzzingInput(buffer, mh);
|
||||
(void)mh.IsValid(pchMessageStart);
|
||||
(void)mh.IsCommandValid();
|
||||
#elif ADDRESS_DESERIALIZE
|
||||
CAddress a;
|
||||
DeserializeFromFuzzingInput(buffer, a);
|
||||
|
||||
Reference in New Issue
Block a user