aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
authorRaúl Martínez (RME) <i-rme@users.noreply.github.com>2020-08-25 00:40:23 +0200
committerRaúl Martínez (RME) <rme@rme.li>2020-08-28 14:17:28 +0200
commit7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce (patch)
tree23838d4ae215da6e9f08dae4812680125c7f4908 /src/netaddress.cpp
parent8d6224fefe015c2022d00a79a4549464bd79cf2f (diff)
downloadbitcoin-7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce.tar.xz
Remove old check for 3-byte shifted IP addresses from pre-0.2.9 node messages
The change removes an old check for IPv6 addresses in range ::ff:ff00:0:0:0/72 that were created due to a bug in size field of addr messages for 0.2.8 nodes and before. This check is no longer needed as they are no more pre 0.2.9 nodes on the network (as per bitnodes network snapshot). Credits for discovering this go to sipa.
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index cb874e5e31..04940f7f94 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -269,17 +269,6 @@ bool CNetAddr::IsLocal() const
*/
bool CNetAddr::IsValid() const
{
- // Cleanup 3-byte shifted addresses caused by garbage in size field
- // of addr messages from versions before 0.2.9 checksum.
- // Two consecutive addr messages look like this:
- // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
- // so if the first length field is garbled, it reads the second batch
- // of addr misaligned by 3 bytes.
- if (IsIPv6() && memcmp(m_addr.data(), IPV4_IN_IPV6_PREFIX.data() + 3,
- sizeof(IPV4_IN_IPV6_PREFIX) - 3) == 0) {
- return false;
- }
-
// unspecified IPv6 address (::/128)
unsigned char ipNone6[16] = {};
if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {