Browse Source

src/main.cpp: endian compatibility in packet checksum check

tags/v0.15.1
Wladimir J. van der Laan 6 years ago
parent
commit
556814ec4e
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/main.cpp

+ 1
- 2
src/main.cpp View File

@@ -4318,8 +4318,7 @@ bool ProcessMessages(CNode* pfrom)
// Checksum
CDataStream& vRecv = msg.vRecv;
uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);
unsigned int nChecksum = 0;
memcpy(&nChecksum, &hash, sizeof(nChecksum));
unsigned int nChecksum = ReadLE32((unsigned char*)&hash);
if (nChecksum != hdr.nChecksum)
{
LogPrintf("ProcessMessages(%s, %u bytes): CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n",

Loading…
Cancel
Save