Browse Source

src/net.cpp: endian compatibility in EndMessage

0.13
Wladimir J. van der Laan 10 years ago
parent
commit
dec84cae2a
  1. 3
      src/net.cpp

3
src/net.cpp

@ -14,6 +14,7 @@
#include "clientversion.h" #include "clientversion.h"
#include "primitives/transaction.h" #include "primitives/transaction.h"
#include "ui_interface.h" #include "ui_interface.h"
#include "crypto/common.h"
#ifdef WIN32 #ifdef WIN32
#include <string.h> #include <string.h>
@ -2007,7 +2008,7 @@ void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend)
// Set the size // Set the size
unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_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 // Set the checksum
uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end()); uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end());

Loading…
Cancel
Save