From cba7e5350dd7d865b560fde48dc9afea504c3a09 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 20 Jan 2025 18:17:41 -0500 Subject: [PATCH] drop router's buffer after a while without updates --- libi2pd/NetDb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libi2pd/NetDb.cpp b/libi2pd/NetDb.cpp index 2e29961e..e5d3fc09 100644 --- a/libi2pd/NetDb.cpp +++ b/libi2pd/NetDb.cpp @@ -683,6 +683,10 @@ namespace data updatedCount++; continue; } + else if (r->GetBuffer () && ts > r->GetTimestamp () + NETDB_MIN_EXPIRATION_TIMEOUT*1000LL) + // since update was long time ago we assume that router is not connected anymore + r->ScheduleBufferToDelete (); + if (r->GetProfile ()->IsUnreachable ()) r->SetUnreachable (true); // make router reachable back if too few routers or floodfills