Browse Source

pick routers with any bandwidth if limited connectivity

pull/2101/head
orignal 1 month ago
parent
commit
c8958d71a2
  1. 4
      libi2pd/TunnelPool.cpp

4
libi2pd/TunnelPool.cpp

@ -549,7 +549,7 @@ namespace tunnel @@ -549,7 +549,7 @@ 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++)
{
@ -587,7 +587,7 @@ namespace tunnel @@ -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
{

Loading…
Cancel
Save