mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Change CMessageHeader Constructor
This commit removes the single-parameter contructor of CMessageHeader and replaces it with a default constructor. The single parameter contructor isn't used anywhere except for tests. There is no reason to initialize a CMessageHeader with a particular messagestart. This messagestart should always be replaced when deserializing an actual message header so that we can run checks on it. The default constructor initializes it to zero, just like the command and checksum. This also removes a parameter of a V1TransportDeserializer constructor, as it was only used for this purpose.
This commit is contained in:
@@ -190,7 +190,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||
AssertEqualAfterSerializeDeserialize(s);
|
||||
#elif MESSAGEHEADER_DESERIALIZE
|
||||
const CMessageHeader::MessageStartChars pchMessageStart = {0x00, 0x00, 0x00, 0x00};
|
||||
CMessageHeader mh(pchMessageStart);
|
||||
CMessageHeader mh;
|
||||
DeserializeFromFuzzingInput(buffer, mh);
|
||||
(void)mh.IsValid(pchMessageStart);
|
||||
#elif ADDRESS_DESERIALIZE
|
||||
|
||||
Reference in New Issue
Block a user