mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
p2p: remove pre-addrv2 onions from SerializeV1Array()
This commit is contained in:
parent
4192a74413
commit
cff5ec477a
1 changed files with 2 additions and 11 deletions
|
@ -333,23 +333,14 @@ class CNetAddr
|
||||||
memcpy(arr, IPV4_IN_IPV6_PREFIX.data(), prefix_size);
|
memcpy(arr, IPV4_IN_IPV6_PREFIX.data(), prefix_size);
|
||||||
memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
|
memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
|
||||||
return;
|
return;
|
||||||
case NET_ONION:
|
|
||||||
if (m_addr.size() == ADDR_TORV3_SIZE) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
prefix_size = sizeof(TORV2_IN_IPV6_PREFIX);
|
|
||||||
assert(prefix_size + m_addr.size() == sizeof(arr));
|
|
||||||
memcpy(arr, TORV2_IN_IPV6_PREFIX.data(), prefix_size);
|
|
||||||
memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
|
|
||||||
return;
|
|
||||||
case NET_INTERNAL:
|
case NET_INTERNAL:
|
||||||
prefix_size = sizeof(INTERNAL_IN_IPV6_PREFIX);
|
prefix_size = sizeof(INTERNAL_IN_IPV6_PREFIX);
|
||||||
assert(prefix_size + m_addr.size() == sizeof(arr));
|
assert(prefix_size + m_addr.size() == sizeof(arr));
|
||||||
memcpy(arr, INTERNAL_IN_IPV6_PREFIX.data(), prefix_size);
|
memcpy(arr, INTERNAL_IN_IPV6_PREFIX.data(), prefix_size);
|
||||||
memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
|
memcpy(arr + prefix_size, m_addr.data(), m_addr.size());
|
||||||
return;
|
return;
|
||||||
|
case NET_ONION:
|
||||||
case NET_I2P:
|
case NET_I2P:
|
||||||
break;
|
|
||||||
case NET_CJDNS:
|
case NET_CJDNS:
|
||||||
break;
|
break;
|
||||||
case NET_UNROUTABLE:
|
case NET_UNROUTABLE:
|
||||||
|
@ -357,7 +348,7 @@ class CNetAddr
|
||||||
assert(false);
|
assert(false);
|
||||||
} // no default case, so the compiler can warn about missing cases
|
} // no default case, so the compiler can warn about missing cases
|
||||||
|
|
||||||
// Serialize TORv3, I2P and CJDNS as all-zeros.
|
// Serialize ONION, I2P and CJDNS as all-zeros.
|
||||||
memset(arr, 0x0, V1_SERIALIZATION_SIZE);
|
memset(arr, 0x0, V1_SERIALIZATION_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue