mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
request only not found routers from introducers
This commit is contained in:
parent
bacce7dc60
commit
df6d48dbae
|
@ -794,6 +794,7 @@ namespace transport
|
|||
i++;
|
||||
}
|
||||
// we have to start a new session to an introducer
|
||||
std::vector<i2p::data::IdentHash> newRouters;
|
||||
std::shared_ptr<i2p::data::RouterInfo> r;
|
||||
uint32_t relayTag = 0;
|
||||
if (!indices.empty ())
|
||||
|
@ -806,12 +807,17 @@ 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 ()))
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue