create new list of SSU2 introducers

This commit is contained in:
orignal 2022-07-19 18:38:58 -04:00
parent 6f7ab49346
commit cf0d3b5f61
5 changed files with 69 additions and 6 deletions

View file

@ -1065,6 +1065,17 @@ namespace data
});
}
bool RouterInfo::IsSSU2Introducer (bool v4) const
{
if (!(m_SupportedTransports & (v4 ? eSSU2V4 : eSSU2V6))) return false;
return (bool)GetAddress (
[v4](std::shared_ptr<const RouterInfo::Address> address)->bool
{
return (address->IsSSU2 ()) && address->IsIntroducer () &&
((v4 && address->IsV4 ()) || (!v4 && address->IsV6 ())) && !address->host.is_unspecified ();
});
}
void RouterInfo::SetUnreachableAddressesTransportCaps (uint8_t transports)
{
for (auto& addr: *m_Addresses)