Browse Source

don't sample too small list of eligible introducers

pull/2105/head
orignal 2 months ago
parent
commit
1a6109109a
  1. 5
      libi2pd/SSU2.cpp

5
libi2pd/SSU2.cpp

@ -1240,7 +1240,10 @@ namespace transport @@ -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…
Cancel
Save