diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-08-23 11:11:30 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-08-23 11:11:34 -0400 |
commit | 5b52aa68584f6c5ea2f942db8f3a7c1feef2cf43 (patch) | |
tree | 865a7317801ec833f4b923a257aa34c4bf787b91 | |
parent | 271b379e636afa419c5208cb462c07090490266c (diff) | |
parent | fa74d3d720f72c5f1184ca3e03b0c14a2bc06ed5 (diff) |
Merge #14025: p2p: Remove dead code for nVersion=10300
fa74d3d720 qa: Remove unused deserialization code in msg_version (MarcoFalke)
fa5099ceb7 p2p: Remove dead code for nVersion=10300 (MarcoFalke)
Pull request description:
This code is undocumented and confusing as well as dead, since peers with a version that old are disconnected immediately.
Tree-SHA512: 58c131a2730b630ffdc191cd65fe736ed1bd57e184902e2af1b1399443c4654617e68774432016df023434055e85d2e8cd32fb03b40c508c3bb8db6d19427434
-rw-r--r-- | src/net_processing.cpp | 5 | ||||
-rwxr-xr-x | test/functional/test_framework/messages.py | 21 |
2 files changed, 6 insertions, 20 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 88999ba735..0fad012257 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1662,8 +1662,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr return false; } - if (nVersion < MIN_PEER_PROTO_VERSION) - { + if (nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version LogPrint(BCLog::NET, "peer=%d using obsolete version %i; disconnecting\n", pfrom->GetId(), nVersion); if (enable_bip61) { @@ -1674,8 +1673,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr return false; } - if (nVersion == 10300) - nVersion = 300; if (!vRecv.empty()) vRecv >> addrFrom >> nNonce; if (!vRecv.empty()) { diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 7276f6b450..0a3907cba4 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -904,28 +904,17 @@ class msg_version(): def deserialize(self, f): self.nVersion = struct.unpack("<i", f.read(4))[0] - if self.nVersion == 10300: - self.nVersion = 300 self.nServices = struct.unpack("<Q", f.read(8))[0] self.nTime = struct.unpack("<q", f.read(8))[0] self.addrTo = CAddress() self.addrTo.deserialize(f, False) - if self.nVersion >= 106: - self.addrFrom = CAddress() - self.addrFrom.deserialize(f, False) - self.nNonce = struct.unpack("<Q", f.read(8))[0] - self.strSubVer = deser_string(f) - else: - self.addrFrom = None - self.nNonce = None - self.strSubVer = None - self.nStartingHeight = None + self.addrFrom = CAddress() + self.addrFrom.deserialize(f, False) + self.nNonce = struct.unpack("<Q", f.read(8))[0] + self.strSubVer = deser_string(f) - if self.nVersion >= 209: - self.nStartingHeight = struct.unpack("<i", f.read(4))[0] - else: - self.nStartingHeight = None + self.nStartingHeight = struct.unpack("<i", f.read(4))[0] if self.nVersion >= 70001: # Relay field is optional for version 70001 onwards |