Skip to content

Commit

Permalink
pick routers with any bandwidth if limited connectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Sep 21, 2024
1 parent e4962b8 commit c8958d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libi2pd/TunnelPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,12 @@ namespace tunnel
std::shared_ptr<const i2p::data::RouterInfo> TunnelPool::SelectNextHop (std::shared_ptr<const i2p::data::RouterInfo> prevHop,
bool reverse, bool endpoint) const
{
bool tryClient = !IsExploratory ();
bool tryClient = !IsExploratory () && !i2p::context.IsLimitedConnectivity ();
std::shared_ptr<const i2p::data::RouterInfo> hop;
for (int i = 0; i < TUNNEL_POOL_MAX_HOP_SELECTION_ATTEMPTS; i++)
{
hop = tryClient ?
(m_IsHighBandwidth ?
(m_IsHighBandwidth ?
i2p::data::netdb.GetHighBandwidthRandomRouter (prevHop, reverse, endpoint) :
i2p::data::netdb.GetRandomRouter (prevHop, reverse, endpoint, true)):
i2p::data::netdb.GetRandomRouter (prevHop, reverse, endpoint, false);
Expand Down Expand Up @@ -587,7 +587,7 @@ namespace tunnel
else if (i2p::transport::transports.GetNumPeers () > 100 ||
(inbound && i2p::transport::transports.GetNumPeers () > 25))
{
auto r = i2p::transport::transports.GetRandomPeer (m_IsHighBandwidth);
auto r = i2p::transport::transports.GetRandomPeer (m_IsHighBandwidth && !i2p::context.IsLimitedConnectivity ());
if (r && r->IsECIES () && !r->GetProfile ()->IsBad () &&
(numHops > 1 || (r->IsV4 () && (!inbound || r->IsPublished (true))))) // first inbound must be published ipv4
{
Expand Down

0 comments on commit c8958d7

Please sign in to comment.