mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
peer test for ipv6
This commit is contained in:
parent
34eee2fc26
commit
9e050d1a23
9 changed files with 82 additions and 62 deletions
|
@ -1100,15 +1100,15 @@ namespace data
|
|||
GetIdentity ()->GetSigningKeyType () != SIGNING_KEY_TYPE_DSA_SHA1;
|
||||
}
|
||||
|
||||
bool RouterInfo::IsPeerTesting (bool v4only) const
|
||||
bool RouterInfo::IsPeerTesting (bool v4) const
|
||||
{
|
||||
auto supportedTransports = m_SupportedTransports & (eSSUV4 | eSSUV6);
|
||||
if (!supportedTransports) return false; // no SSU
|
||||
if (v4only && !(supportedTransports & eSSUV4)) return false; // no SSU v4
|
||||
auto supportedTransports = m_SupportedTransports & (v4 ? eSSUV4 : eSSUV6);
|
||||
if (!supportedTransports) return false;
|
||||
return (bool)GetAddress (
|
||||
[](std::shared_ptr<const RouterInfo::Address> address)->bool
|
||||
[v4](std::shared_ptr<const RouterInfo::Address> address)->bool
|
||||
{
|
||||
return (address->transportStyle == eTransportSSU) && address->IsPeerTesting ();
|
||||
return (address->transportStyle == eTransportSSU) && address->IsPeerTesting () &&
|
||||
((v4 && address->IsV4 ()) || (!v4 && address->IsV6 ()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue