use size / 2 as the number of transit paths

This commit is contained in:
Jeff Becker 2020-03-03 18:16:08 -05:00
parent 05082e2507
commit add305b9f4
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 3 additions and 12 deletions

View File

@ -289,18 +289,9 @@ namespace llarp
uint64_t
PathContext::CurrentTransitPaths()
{
std::unordered_set< TransitHopInfo, TransitHopInfo::Hash > paths;
{
SyncTransitMap_t::Lock_t lock(m_TransitPaths.first);
auto& map = m_TransitPaths.second;
auto itr = map.begin();
while(itr != map.end())
{
paths.insert(itr->second->info);
++itr;
}
}
return paths.size();
SyncTransitMap_t::Lock_t lock(m_TransitPaths.first);
auto& map = m_TransitPaths.second;
return map.size() / 2;
}
void