aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorTroy Giorshev <troygiorshev@gmail.com>2020-06-08 22:37:55 -0400
committerTroy Giorshev <troygiorshev@gmail.com>2020-09-22 22:01:14 -0400
commit5bceef6b12fa16d20287693be377dace3dfec3e5 (patch)
tree0a6fee9b1bdea143702adc97cc01a3a4a2a7928a /src/protocol.h
parent1ca20c1af8f08f07c407c3183c37b467ddf0f413 (diff)
downloadbitcoin-5bceef6b12fa16d20287693be377dace3dfec3e5.tar.xz
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.
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h
index 7fb84cddf1..3bf0797ca4 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -37,7 +37,7 @@ public:
static constexpr size_t HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE;
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
- explicit CMessageHeader(const MessageStartChars& pchMessageStartIn);
+ explicit CMessageHeader();
/** Construct a P2P message header from message-start characters, a command and the size of the message.
* @note Passing in a `pszCommand` longer than COMMAND_SIZE will result in a run-time assertion error.