From df6d48dbae0f5304e27f02365a42a0ff13b8b166 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 7 Jun 2024 13:29:51 -0400 Subject: [PATCH] request only not found routers from introducers --- libi2pd/SSU2.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libi2pd/SSU2.cpp b/libi2pd/SSU2.cpp index 81744312..81fe20b4 100644 --- a/libi2pd/SSU2.cpp +++ b/libi2pd/SSU2.cpp @@ -794,6 +794,7 @@ namespace transport i++; } // we have to start a new session to an introducer + std::vector newRouters; std::shared_ptr r; uint32_t relayTag = 0; if (!indices.empty ()) @@ -806,11 +807,16 @@ namespace transport const auto& introducer = address->ssu->introducers[ind]; // introducer is not expired, because in indices r = i2p::data::netdb.FindRouter (introducer.iH); - if (r && r->IsReachableFrom (i2p::context.GetRouterInfo ())) - { - relayTag = introducer.iTag; - if (relayTag) break; - } + if (r) + { + if (r->IsReachableFrom (i2p::context.GetRouterInfo ())) + { + relayTag = introducer.iTag; + if (relayTag) break; + } + } + else if (i2p::data::IsRouterBanned (introducer.iH)) + newRouters.push_back (introducer.iH); } } if (r) @@ -851,9 +857,8 @@ namespace transport else { // introducers not found, try to request them - for (auto& it: address->ssu->introducers) - if (it.iTag && ts < it.iExp) - i2p::data::netdb.RequestDestination (it.iH); + for (auto& it: newRouters) + i2p::data::netdb.RequestDestination (it); } }