don't select non-connected peer for first hop if too many connection from that subnet

This commit is contained in:
orignal
2026-03-26 21:09:41 -04:00
parent 8f24f0043d
commit 54ea2be8e0
3 changed files with 42 additions and 16 deletions
+2 -1
View File
@@ -578,7 +578,8 @@ namespace tunnel
i2p::data::netdb.GetRandomRouter (prevHop, reverse, endpoint, false);
if (hop)
{
if (!hop->HasProfile () || !hop->GetProfile ()->IsBad ())
if ((!hop->HasProfile () || !hop->GetProfile ()->IsBad ()) &&
(prevHop != i2p::context.GetSharedRouterInfo () || !i2p::transport::transports.IsTooManyConnectionsFromSubnet (hop)))
break;
}
else if (tryClient)