mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
ipv4 only
This commit is contained in:
parent
ddb9a6b477
commit
fcad819074
2 changed files with 12 additions and 6 deletions
|
@ -265,22 +265,28 @@ namespace data
|
|||
return false;
|
||||
}
|
||||
|
||||
bool RouterInfo::IsNTCP () const
|
||||
bool RouterInfo::IsNTCP (bool v4only) const
|
||||
{
|
||||
for (auto& address : m_Addresses)
|
||||
{
|
||||
if (address.transportStyle == eTransportNTCP)
|
||||
return true;
|
||||
{
|
||||
if (!v4only || address.host.is_v4 ())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
RouterInfo::Address * RouterInfo::GetNTCPAddress ()
|
||||
RouterInfo::Address * RouterInfo::GetNTCPAddress (bool v4only)
|
||||
{
|
||||
for (auto& address : m_Addresses)
|
||||
{
|
||||
if (address.transportStyle == eTransportNTCP)
|
||||
return &address;
|
||||
{
|
||||
if (!v4only || address.host.is_v4 ())
|
||||
return &address;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue