From 2caffa56e83208cb86e0c7d7e6955bb22f2104d2 Mon Sep 17 00:00:00 2001 From: dr|z3d Date: Sun, 5 Sep 2021 03:12:01 +0000 Subject: [PATCH] TunnelPool: don't enforce ECIES for tunnel selection for now, causes seg fault. --- libi2pd/TunnelPool.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libi2pd/TunnelPool.cpp b/libi2pd/TunnelPool.cpp index f4038491..447449c9 100644 --- a/libi2pd/TunnelPool.cpp +++ b/libi2pd/TunnelPool.cpp @@ -453,7 +453,7 @@ namespace tunnel (inbound && i2p::transport::transports.GetNumPeers () > 25)) { auto r = i2p::transport::transports.GetRandomPeer (); - if (r && r->IsECIES () && !r->GetProfile ()->IsBad () && + if (r && r->IsECIES () && !r->GetProfile ()->IsBad () && (numHops > 1 || (r->IsV4 () && (!inbound || r->IsReachable ())))) // first inbound must be reachable { prevHop = r; @@ -467,9 +467,9 @@ namespace tunnel 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"); + LogPrint (eLogInfo, "Tunnels: No suitable peer found for first hop, trying existing connections"); hop = i2p::transport::transports.GetRandomPeer (); - if (!hop->IsECIES ()) hop = nullptr; + //if (!hop->IsECIES ()) hop = nullptr; } if (!hop) { @@ -514,15 +514,15 @@ namespace tunnel auto& ident = (*m_ExplicitPeers)[i]; auto r = i2p::data::netdb.FindRouter (ident); if (r) - { - if (r->IsECIES ()) + { + if (r->IsECIES ()) path.Add (r); else - { + { LogPrint (eLogError, "Tunnels: ElGamal router ", ident.ToBase64 (), " is not supported"); - return false; - } - } + return false; + } + } else { LogPrint (eLogInfo, "Tunnels: Can't find router for ", ident.ToBase64 ());