Skip to content

Commit ed72a2e

Browse files
authored
Merge pull request #2390 from barton2526/nMessageSize
net: initialize nMessageSize to uint32_t max
2 parents 7506c24 + 19ff619 commit ed72a2e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/protocol.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ CMessageHeader::CMessageHeader()
2525
{
2626
memcpy(pchMessageStart, Params().MessageStart(), CMessageHeader::MESSAGE_START_SIZE);
2727
memset(pchCommand, 0, sizeof(pchCommand));
28-
nMessageSize = -1;
2928
memset(pchChecksum, 0, CHECKSUM_SIZE);
3029
}
3130

src/protocol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "uint256.h"
1616
#include "version.h"
1717

18+
#include <limits>
1819
#include <string>
1920

2021
extern bool fTestNet;
@@ -52,7 +53,7 @@ class CMessageHeader
5253

5354
char pchMessageStart[MESSAGE_START_SIZE];
5455
char pchCommand[COMMAND_SIZE];
55-
uint32_t nMessageSize;
56+
uint32_t nMessageSize{std::numeric_limits<uint32_t>::max()};
5657
uint8_t pchChecksum[CHECKSUM_SIZE];
5758
};
5859

0 commit comments

Comments
 (0)