insert previously ecluded floodfill back when connected

This commit is contained in:
orignal 2024-04-28 11:16:59 -04:00
parent 720ffa8a31
commit 77bb7432bc
4 changed files with 40 additions and 11 deletions

View file

@ -298,7 +298,7 @@ namespace data
if (m_Floodfills.GetSize () < NETDB_NUM_FLOODFILLS_THRESHOLD || r->GetProfile ()->IsReal ())
m_Floodfills.Insert (r);
else
r->ResetFloodFill ();
r->ResetFloodfill ();
}
}
}
@ -333,7 +333,7 @@ namespace data
m_Floodfills.Insert (r);
}
else
r->ResetFloodFill ();
r->ResetFloodfill ();
}
}
else
@ -458,7 +458,16 @@ namespace data
r->SetUnreachable (unreachable);
auto profile = r->GetProfile ();
if (profile)
{
profile->Unreachable (unreachable);
if (!unreachable && r->IsDeclaredFloodfill () && !r->IsFloodfill () &&
r->IsEligibleFloodfill () && profile->IsReal ())
{
// enable previously disabled floodfill
std::lock_guard<std::mutex> l(m_FloodfillsMutex);
m_Floodfills.Insert (r);
}
}
}
}