diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-12-19 11:38:30 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-06 17:21:55 +0100 |
commit | 556814ec4ec7e2c5a1b441f8b9a49dbf715fec6b (patch) | |
tree | d3d84ddb9d4025bd68d677d4acec639e01cb98f6 | |
parent | 3ca5852dc27cec926e4e7b09ec3ccc369a2a0781 (diff) |
src/main.cpp: endian compatibility in packet checksum check
-rw-r--r-- | src/main.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index b6a61f7da1..9927ac7598 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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", |