From 924a7bc533c0dff7954fbd47919a0e4eba5e3add Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 2 Mar 2021 12:29:51 -0500 Subject: [PATCH] use connected peers if others not available --- libi2pd/TunnelPool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libi2pd/TunnelPool.cpp b/libi2pd/TunnelPool.cpp index f7603652..07d9a205 100644 --- a/libi2pd/TunnelPool.cpp +++ b/libi2pd/TunnelPool.cpp @@ -430,6 +430,11 @@ namespace tunnel for(int i = 0; i < numHops; i++ ) { auto hop = nextHop (prevHop, inbound); + if (!hop && !i) // if no suitable peer found for first hop, try already connected + { + LogPrint (eLogInfo, "Tunnels: Can't select first hop for a tunnel. Trying already connected"); + hop = i2p::transport::transports.GetRandomPeer (); + } if (!hop) { LogPrint (eLogError, "Tunnels: Can't select next hop for ", prevHop->GetIdentHashBase64 ());