mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 09:04:14 +00:00
NetDB: ignore LeaseSet store request if not floodfill
Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
parent
dfe5df29e1
commit
09f233dbfb
@ -267,12 +267,12 @@ namespace data
|
|||||||
if (wasFloodfill)
|
if (wasFloodfill)
|
||||||
m_Floodfills.Remove (r->GetIdentHash ());
|
m_Floodfills.Remove (r->GetIdentHash ());
|
||||||
else if (r->IsEligibleFloodfill ())
|
else if (r->IsEligibleFloodfill ())
|
||||||
{
|
{
|
||||||
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD || r->GetProfile ()->IsReal ())
|
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD || r->GetProfile ()->IsReal ())
|
||||||
m_Floodfills.Insert (r);
|
m_Floodfills.Insert (r);
|
||||||
else
|
else
|
||||||
r->ResetFlooldFill ();
|
r->ResetFlooldFill ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -296,10 +296,10 @@ namespace data
|
|||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
|
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
|
||||||
if (r->IsFloodfill () && r->IsEligibleFloodfill ())
|
if (r->IsFloodfill () && r->IsEligibleFloodfill ())
|
||||||
{
|
{
|
||||||
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD ||
|
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD ||
|
||||||
r->GetProfile ()->IsReal ()) // don't insert floodfill until it's known real if we have enough
|
r->GetProfile ()->IsReal ()) // don't insert floodfill until it's known real if we have enough
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||||
m_Floodfills.Insert (r);
|
m_Floodfills.Insert (r);
|
||||||
}
|
}
|
||||||
@ -840,7 +840,12 @@ namespace data
|
|||||||
LogPrint (eLogError, "NetDb: Database store message is too long ", len);
|
LogPrint (eLogError, "NetDb: Database store message is too long ", len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!m->from) // unsolicited LS must be received directly
|
if (!context.IsFloodfill ())
|
||||||
|
{
|
||||||
|
LogPrint (eLogInfo, "NetDb: Not Floodfill, LeaseSet store request ignored for ", ident.ToBase32());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (!m->from) // unsolicited LS must be received directly
|
||||||
{
|
{
|
||||||
if (storeType == NETDB_STORE_TYPE_LEASESET) // 1
|
if (storeType == NETDB_STORE_TYPE_LEASESET) // 1
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user