update introducers. cleanup unreachable routers

This commit is contained in:
orignal 2023-04-05 21:30:36 -04:00
parent e3fb9d8483
commit 9475a22728
5 changed files with 69 additions and 29 deletions

View file

@ -498,7 +498,8 @@ namespace tunnel
{
auto r = i2p::transport::transports.GetRandomPeer (!IsExploratory ());
if (r && r->IsECIES () && !r->GetProfile ()->IsBad () &&
(numHops > 1 || (r->IsV4 () && (!inbound || r->IsReachable ())))) // first inbound must be reachable
(numHops > 1 || (r->IsV4 () && (!inbound ||
r->IsReachableBy (i2p::data::RouterInfo::eNTCP2V4 | i2p::data::RouterInfo::eSSU2V4))))) // first inbound must be reachable
{
prevHop = r;
path.Add (r);
@ -520,8 +521,8 @@ namespace tunnel
LogPrint (eLogError, "Tunnels: Can't select next hop for ", prevHop->GetIdentHashBase64 ());
return false;
}
if ((i == numHops - 1) && (!hop->IsV4 () || // doesn't support ipv4
(inbound && !hop->IsReachable ()))) // IBGW is not reachable
if ((i == numHops - 1) && (!hop->IsV4 () || (inbound && // doesn't support ipv4
!hop->IsReachableBy (i2p::data::RouterInfo::eNTCP2V4 | i2p::data::RouterInfo::eSSU2V4)))) // IBGW is not reachable
{
auto hop1 = nextHop (prevHop, true);
if (hop1) hop = hop1;