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
|
@ -1239,8 +1239,11 @@ namespace transport
|
||||||
(!v4 && (s.second->GetRemoteTransports () & i2p::data::RouterInfo::eSSU2V6))))
|
(!v4 && (s.second->GetRemoteTransports () & i2p::data::RouterInfo::eSSU2V6))))
|
||||||
eligible.push_back (s.second);
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue