diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-22 11:06:44 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-22 11:06:44 -0500 |
commit | e7e6ae210458e37a012d5557cd0267b2d86d9fa8 (patch) | |
tree | 9367444cf9894f36bb87d6618d0bb5b9d6c34bd6 /src/net.h | |
parent | 8c7358e1ddc16048c3f2f3cd58caf8c1d7798ba4 (diff) | |
parent | 18c0fa97d0408a3ee8e4cb39c08156f7667f99ac (diff) |
Merge branch 'postfeb20' of https://github.com/sipa/bitcoin
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -167,15 +167,9 @@ public: nServices = 0; hSocket = hSocketIn; vSend.SetType(SER_NETWORK); - vSend.SetVersion(0); vRecv.SetType(SER_NETWORK); - vRecv.SetVersion(0); - // Version 0.2 obsoletes 20 Feb 2012 - if (GetTime() > 1329696000) - { - vSend.SetVersion(209); - vRecv.SetVersion(209); - } + vSend.SetVersion(209); + vRecv.SetVersion(209); nLastSend = 0; nLastRecv = 0; nLastSendEmpty = GetTime(); @@ -334,14 +328,11 @@ public: memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nMessageSize), &nSize, sizeof(nSize)); // Set the checksum - if (vSend.GetVersion() >= 209) - { - uint256 hash = Hash(vSend.begin() + nMessageStart, vSend.end()); - unsigned int nChecksum = 0; - memcpy(&nChecksum, &hash, sizeof(nChecksum)); - assert(nMessageStart - nHeaderStart >= offsetof(CMessageHeader, nChecksum) + sizeof(nChecksum)); - memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum)); - } + uint256 hash = Hash(vSend.begin() + nMessageStart, vSend.end()); + unsigned int nChecksum = 0; + memcpy(&nChecksum, &hash, sizeof(nChecksum)); + assert(nMessageStart - nHeaderStart >= offsetof(CMessageHeader, nChecksum) + sizeof(nChecksum)); + memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum)); if (fDebug) { printf("(%d bytes)\n", nSize); |