aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-20 01:33:31 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-21 20:46:39 +0100
commit18c0fa97d0408a3ee8e4cb39c08156f7667f99ac (patch)
tree5a49fa04a410626fe2e04628f98944be2017298d /src/net.h
parent8a949dd6c3ce8161967330ebabf8ba021c0a6295 (diff)
Post-feb20 simplifications
Now the entire network upgraded to (initial) protocol version 209, crtainl simplifications in the source code are possible.
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 0a3cf388ec..e3e92dad84 100644
--- a/src/net.h
+++ b/src/net.h
@@ -166,15 +166,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();
@@ -333,14 +327,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);