mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
find new introducers to connect
This commit is contained in:
parent
7a19533380
commit
db93a7315f
3 changed files with 10 additions and 8 deletions
|
@ -1168,12 +1168,13 @@ namespace data
|
|||
});
|
||||
}
|
||||
|
||||
std::shared_ptr<const RouterInfo> NetDb::GetRandomIntroducer (bool v4) const
|
||||
std::shared_ptr<const RouterInfo> NetDb::GetRandomIntroducer (bool v4, const std::set<IdentHash>& excluded) const
|
||||
{
|
||||
return GetRandomRouter (
|
||||
[v4](std::shared_ptr<const RouterInfo> router)->bool
|
||||
[v4, &excluded](std::shared_ptr<const RouterInfo> router)->bool
|
||||
{
|
||||
return router->IsIntroducer (v4) && !router->IsHidden () && !router->IsFloodfill (); // floodfills don't send relay tag
|
||||
return router->IsIntroducer (v4) && !excluded.count (router->GetIdentHash ()) &&
|
||||
!router->IsHidden () && !router->IsFloodfill (); // floodfills don't send relay tag
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue