mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
reset floodfill cap for unknown floodfills
This commit is contained in:
parent
b6de474fda
commit
c757b6d020
2 changed files with 16 additions and 6 deletions
|
@ -267,7 +267,12 @@ namespace data
|
|||
if (wasFloodfill)
|
||||
m_Floodfills.Remove (r->GetIdentHash ());
|
||||
else if (r->IsEligibleFloodfill ())
|
||||
m_Floodfills.Insert (r);
|
||||
{
|
||||
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD || r->GetProfile ()->IsReal ())
|
||||
m_Floodfills.Insert (r);
|
||||
else
|
||||
r->ResetFlooldFill ();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -290,12 +295,16 @@ namespace data
|
|||
if (inserted)
|
||||
{
|
||||
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
|
||||
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
|
||||
if (r->IsFloodfill () && r->IsEligibleFloodfill ())
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||
m_Floodfills.Insert (r);
|
||||
if (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);
|
||||
}
|
||||
else
|
||||
r->ResetFlooldFill ();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue