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,6 +1240,9 @@ namespace transport
|
|||||||
eligible.push_back (s.second);
|
eligible.push_back (s.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eligible.size () <= (size_t)maxNumIntroducers)
|
||||||
|
return eligible;
|
||||||
|
else
|
||||||
std::sample (eligible.begin(), eligible.end(), std::back_inserter(ret), maxNumIntroducers, m_Rng);
|
std::sample (eligible.begin(), eligible.end(), std::back_inserter(ret), maxNumIntroducers, m_Rng);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user