aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-02-22 11:06:44 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-02-22 11:06:44 -0500
commite7e6ae210458e37a012d5557cd0267b2d86d9fa8 (patch)
tree9367444cf9894f36bb87d6618d0bb5b9d6c34bd6 /src/net.h
parent8c7358e1ddc16048c3f2f3cd58caf8c1d7798ba4 (diff)
parent18c0fa97d0408a3ee8e4cb39c08156f7667f99ac (diff)
Merge branch 'postfeb20' of https://github.com/sipa/bitcoin
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/net.h b/src/net.h
index f4af93a495..51a816d4d3 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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);