From edf2828eaf53d963cf9c1e82e6079b52eaaa362f Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 3 Feb 2026 15:45:11 -0500 Subject: [PATCH] delete inactive transit tunnels after 1 minute --- libi2pd/TransitTunnel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libi2pd/TransitTunnel.cpp b/libi2pd/TransitTunnel.cpp index 7c0fe49c..3c8b9946 100644 --- a/libi2pd/TransitTunnel.cpp +++ b/libi2pd/TransitTunnel.cpp @@ -606,9 +606,10 @@ namespace tunnel { auto tunnel = *it; if (ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT || - ts + TUNNEL_EXPIRATION_TIMEOUT < tunnel->GetCreationTime ()) + ts + TUNNEL_EXPIRATION_TIMEOUT < tunnel->GetCreationTime () || + (!tunnel->GetNumTransmittedBytes () && ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_THRESHOLD)) // inactive? { - LogPrint (eLogDebug, "TransitTunnel: Transit tunnel with id ", tunnel->GetTunnelID (), " expired"); + LogPrint (eLogDebug, "TransitTunnel: Transit tunnel with id ", tunnel->GetTunnelID (), " expired or inactive"); tunnels.RemoveTunnel (tunnel->GetTunnelID ()); it = m_TransitTunnels.erase (it); }