mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
don't sample too small list of eligible introducers
This commit is contained in:
@@ -1240,7 +1240,10 @@ namespace transport
|
||||
eligible.push_back (s.second);
|
||||
}
|
||||
|
||||
std::sample (eligible.begin(), eligible.end(), std::back_inserter(ret), maxNumIntroducers, m_Rng);
|
||||
if (eligible.size () <= (size_t)maxNumIntroducers)
|
||||
return eligible;
|
||||
else
|
||||
std::sample (eligible.begin(), eligible.end(), std::back_inserter(ret), maxNumIntroducers, m_Rng);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user