mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
don't sample too small list of eligible introducers
This commit is contained in:
parent
905c6debf2
commit
1a6109109a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue