Browse Source

addrv2 changes

p2p
Duke Leto 3 years ago
parent
commit
d4fe6c81de
  1. 5
      src/addrman.h
  2. 4
      src/netaddress.cpp
  3. 4
      src/netbase.cpp

5
src/addrman.h

@ -309,7 +309,10 @@ public:
/**
* serialized format:
* * version byte (1 for pre-asmap files, 2 for files including asmap version)
* * version byte:
version 1 for pre-asmap files
version 2 for files including asmap version
version 3 for asmap + addrv2 (Tor v3/i2p/cjdns/etc)
* * 0x20 + nKey (serialized as if it were a vector, for backward compatibility)
* * nNew
* * nTried

4
src/netaddress.cpp

@ -5,7 +5,6 @@
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#include <netaddress.h>
#include <crypto/common.h>
#include <crypto/sha3.h>
#include <hash.h>
@ -14,7 +13,6 @@
#include <util/asmap.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <algorithm>
#include <array>
#include <cstdint>
@ -147,7 +145,7 @@ void CNetAddr::SetIP(const CNetAddr& ipIn)
assert(false);
} // no default case, so the compiler can warn about missing cases
m_net = ipIn.m_net;
m_net = ipIn.m_net;
m_addr = ipIn.m_addr;
}

4
src/netbase.cpp

@ -667,11 +667,13 @@ void CNetAddr::SetRaw(Network network, const uint8_t *ip_in)
switch(network)
{
case NET_IPV4:
m_net = NET_IPV4;
memcpy(ip, pchIPv4, 12);
memcpy(ip+12, ip_in, 4);
break;
case NET_IPV6:
memcpy(ip, ip_in, 16);
//memcpy(ip, ip_in, 16);
SetLegacyIPv6(ip_in);
break;
default:
assert(!"invalid network");

Loading…
Cancel
Save