don't include unconfirmed floodfill to the list if we have enough floodfills already

This commit is contained in:
orignal 2023-05-05 16:14:54 -04:00
parent 2f74e670a5
commit b6de474fda
6 changed files with 21 additions and 4 deletions

View file

@ -290,8 +290,10 @@ namespace data
if (inserted)
{
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
if (r->IsFloodfill () && r->IsEligibleFloodfill ())
{
if (r->IsFloodfill () && r->IsEligibleFloodfill () &&
(m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD ||
r->GetProfile ()->IsReal ())) // don't insert floodfill until it's known real if we have enough
{
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
m_Floodfills.Insert (r);
}