clear profiles on removal

pull/477/head
Jeff Becker 5 years ago
parent aea9944c3d
commit 169d8beded
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -111,6 +111,13 @@ namespace llarp
m_Profiles[r].lastUpdated = llarp::time_now_ms();
}
void
Profiling::ClearProfile(const RouterID& r)
{
lock_t lock(&m_ProfilesMutex);
m_Profiles.erase(r);
}
void
Profiling::MarkPathFail(path::Path* p)
{

@ -68,6 +68,9 @@ namespace llarp
void
MarkPathSuccess(path::Path* p) LOCKS_EXCLUDED(m_ProfilesMutex);
void
ClearProfile(const RouterID& r) LOCKS_EXCLUDED(m_ProfilesMutex);
void
Tick() LOCKS_EXCLUDED(m_ProfilesMutex);

@ -1075,6 +1075,7 @@ namespace llarp
nodedb()->RemoveIf([&](const RouterContact &rc) -> bool {
if(!routerProfiling().IsBad(rc.pubkey))
return false;
routerProfiling().ClearProfile(rc.pubkey);
removed.insert(rc.pubkey);
return true;
});

Loading…
Cancel
Save