Merge #8880: protocol.h: Move MESSAGE_START_SIZE into CMessageHeader
1df3111protocol.h: Make enums in GetDataMsg concrete values (Wladimir J. van der Laan)2c09a52protocol.h: Move MESSAGE_START_SIZE into CMessageHeader (Wladimir J. van der Laan)f9bd92dversion.h: s/shord/short/ in comment (Wladimir J. van der Laan)
This commit is contained in:
+3
-3
@@ -4371,11 +4371,11 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB
|
||||
unsigned int nSize = 0;
|
||||
try {
|
||||
// locate a header
|
||||
unsigned char buf[MESSAGE_START_SIZE];
|
||||
unsigned char buf[CMessageHeader::MESSAGE_START_SIZE];
|
||||
blkdat.FindByte(chainparams.MessageStart()[0]);
|
||||
nRewind = blkdat.GetPos()+1;
|
||||
blkdat >> FLATDATA(buf);
|
||||
if (memcmp(buf, chainparams.MessageStart(), MESSAGE_START_SIZE))
|
||||
if (memcmp(buf, chainparams.MessageStart(), CMessageHeader::MESSAGE_START_SIZE))
|
||||
continue;
|
||||
// read size
|
||||
blkdat >> nSize;
|
||||
@@ -6266,7 +6266,7 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman)
|
||||
it++;
|
||||
|
||||
// Scan for message start
|
||||
if (memcmp(msg.hdr.pchMessageStart, chainparams.MessageStart(), MESSAGE_START_SIZE) != 0) {
|
||||
if (memcmp(msg.hdr.pchMessageStart, chainparams.MessageStart(), CMessageHeader::MESSAGE_START_SIZE) != 0) {
|
||||
LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", SanitizeString(msg.hdr.GetCommand()), pfrom->id);
|
||||
fOk = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user