aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-19 11:38:30 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-06 17:21:55 +0100
commit556814ec4ec7e2c5a1b441f8b9a49dbf715fec6b (patch)
treed3d84ddb9d4025bd68d677d4acec639e01cb98f6
parent3ca5852dc27cec926e4e7b09ec3ccc369a2a0781 (diff)
src/main.cpp: endian compatibility in packet checksum check
-rw-r--r--src/main.cpp3
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",