|
|
@ -4358,11 +4358,11 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB |
|
|
|
unsigned int nSize = 0; |
|
|
|
unsigned int nSize = 0; |
|
|
|
try { |
|
|
|
try { |
|
|
|
// locate a header
|
|
|
|
// locate a header
|
|
|
|
unsigned char buf[MESSAGE_START_SIZE]; |
|
|
|
unsigned char buf[CMessageHeader::MESSAGE_START_SIZE]; |
|
|
|
blkdat.FindByte(chainparams.MessageStart()[0]); |
|
|
|
blkdat.FindByte(chainparams.MessageStart()[0]); |
|
|
|
nRewind = blkdat.GetPos()+1; |
|
|
|
nRewind = blkdat.GetPos()+1; |
|
|
|
blkdat >> FLATDATA(buf); |
|
|
|
blkdat >> FLATDATA(buf); |
|
|
|
if (memcmp(buf, chainparams.MessageStart(), MESSAGE_START_SIZE)) |
|
|
|
if (memcmp(buf, chainparams.MessageStart(), CMessageHeader::MESSAGE_START_SIZE)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
// read size
|
|
|
|
// read size
|
|
|
|
blkdat >> nSize; |
|
|
|
blkdat >> nSize; |
|
|
@ -6232,7 +6232,7 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman) |
|
|
|
it++; |
|
|
|
it++; |
|
|
|
|
|
|
|
|
|
|
|
// Scan for message start
|
|
|
|
// 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); |
|
|
|
LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", SanitizeString(msg.hdr.GetCommand()), pfrom->id); |
|
|
|
fOk = false; |
|
|
|
fOk = false; |
|
|
|
break; |
|
|
|
break; |
|
|
|