Skip to content
Snippets Groups Projects
Commit 06988396 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

searches: only remove old expired nodes

parent 8512c011
No related branches found
No related tags found
No related merge requests found
......@@ -610,7 +610,8 @@ Dht::Search::removeExpiredNode(time_point now)
auto e = nodes.end();
while (e != nodes.cbegin()) {
e = std::prev(e);
if (e->node->isExpired(now)) {
const Node& n = *e->node;
if (n.isExpired(now) and n.time + NODE_EXPIRE_TIME < now) {
nodes.erase(e);
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment