diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-12-19 11:38:57 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-03-06 17:21:58 +0100 |
| commit | dec84cae2a7534af95873d5d96e38ad96b447d52 (patch) | |
| tree | 64c04330da17f4da94945aea84ef927402342d22 /src/net.cpp | |
| parent | src/main.cpp: endian compatibility in packet checksum check (diff) | |
| download | discoin-dec84cae2a7534af95873d5d96e38ad96b447d52.tar.xz discoin-dec84cae2a7534af95873d5d96e38ad96b447d52.zip | |
src/net.cpp: endian compatibility in EndMessage
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index d9f470b9e..08d1d5740 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -14,6 +14,7 @@ #include "clientversion.h" #include "primitives/transaction.h" #include "ui_interface.h" +#include "crypto/common.h" #ifdef WIN32 #include <string.h> @@ -2007,7 +2008,7 @@ void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend) // Set the size unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE; - memcpy((char*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], &nSize, sizeof(nSize)); + WriteLE32((uint8_t*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], nSize); // Set the checksum uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end()); |