mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
request only not found routers from introducers
This commit is contained in:
parent
bacce7dc60
commit
df6d48dbae
@ -794,6 +794,7 @@ namespace transport
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// we have to start a new session to an introducer
|
// we have to start a new session to an introducer
|
||||||
|
std::vector<i2p::data::IdentHash> newRouters;
|
||||||
std::shared_ptr<i2p::data::RouterInfo> r;
|
std::shared_ptr<i2p::data::RouterInfo> r;
|
||||||
uint32_t relayTag = 0;
|
uint32_t relayTag = 0;
|
||||||
if (!indices.empty ())
|
if (!indices.empty ())
|
||||||
@ -806,11 +807,16 @@ namespace transport
|
|||||||
const auto& introducer = address->ssu->introducers[ind];
|
const auto& introducer = address->ssu->introducers[ind];
|
||||||
// introducer is not expired, because in indices
|
// introducer is not expired, because in indices
|
||||||
r = i2p::data::netdb.FindRouter (introducer.iH);
|
r = i2p::data::netdb.FindRouter (introducer.iH);
|
||||||
if (r && r->IsReachableFrom (i2p::context.GetRouterInfo ()))
|
if (r)
|
||||||
{
|
{
|
||||||
relayTag = introducer.iTag;
|
if (r->IsReachableFrom (i2p::context.GetRouterInfo ()))
|
||||||
if (relayTag) break;
|
{
|
||||||
}
|
relayTag = introducer.iTag;
|
||||||
|
if (relayTag) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (i2p::data::IsRouterBanned (introducer.iH))
|
||||||
|
newRouters.push_back (introducer.iH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (r)
|
if (r)
|
||||||
@ -851,9 +857,8 @@ namespace transport
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// introducers not found, try to request them
|
// introducers not found, try to request them
|
||||||
for (auto& it: address->ssu->introducers)
|
for (auto& it: newRouters)
|
||||||
if (it.iTag && ts < it.iExp)
|
i2p::data::netdb.RequestDestination (it);
|
||||||
i2p::data::netdb.RequestDestination (it.iH);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user