select peer test capable routers

This commit is contained in:
orignal 2015-02-26 14:17:16 -05:00
parent 30715c2512
commit 582daffd7f
3 changed files with 28 additions and 6 deletions

View file

@ -885,6 +885,15 @@ namespace data
});
}
std::shared_ptr<const RouterInfo> NetDb::GetRandomPeerTestRouter () const
{
return GetRandomRouter (
[](std::shared_ptr<const RouterInfo> router)->bool
{
return !router->IsHidden () && router->IsPeerTesting ();
});
}
std::shared_ptr<const RouterInfo> NetDb::GetHighBandwidthRandomRouter (std::shared_ptr<const RouterInfo> compatibleWith) const
{
return GetRandomRouter (