mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
bypass medium congestion(D) routers for client tunnels
This commit is contained in:
parent
572694b141
commit
4ebc7c970a
5 changed files with 25 additions and 12 deletions
|
@ -753,14 +753,15 @@ namespace tunnel
|
|||
return m_CustomPeerSelector != nullptr;
|
||||
}
|
||||
|
||||
bool TunnelPool::ValidatePeers (std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers)
|
||||
bool TunnelPool::ValidatePeers (std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers) const
|
||||
{
|
||||
bool highBandwidth = !IsExploratory ();
|
||||
for (auto it: peers)
|
||||
{
|
||||
auto r = i2p::data::netdb.FindRouter (it->GetIdentHash ());
|
||||
if (r)
|
||||
{
|
||||
if (r->IsHighCongestion ()) return false;
|
||||
if (r->IsHighCongestion (highBandwidth)) return false;
|
||||
it = r->GetIdentity (); // use identity from updated RouterInfo
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue