From bb30a42c2dbe49c43ec80c826b879af8496b12a1 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 5 Feb 2026 18:40:21 -0500 Subject: [PATCH] increase min tunnel build messages interval. don't count if from the same millisecond --- libi2pd/I2NPProtocol.cpp | 3 ++- libi2pd/I2NPProtocol.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libi2pd/I2NPProtocol.cpp b/libi2pd/I2NPProtocol.cpp index f13cb2a9..3fb571c3 100644 --- a/libi2pd/I2NPProtocol.cpp +++ b/libi2pd/I2NPProtocol.cpp @@ -574,7 +574,8 @@ namespace i2p if (m_NumThrottledTunnelBuildMessages < MAX_NUM_THROTTLED_TUNNEL_BUILD_MESSAGES) { // let TBM go through - m_NumThrottledTunnelBuildMessages++; + if (ts > m_LastTunnelBuildMessageTimestamp + 1) // don't count if from the same millisecond + m_NumThrottledTunnelBuildMessages++; HandleI2NPMessage (msg); } else // drop TBM diff --git a/libi2pd/I2NPProtocol.h b/libi2pd/I2NPProtocol.h index 4f2a6080..69bed63f 100644 --- a/libi2pd/I2NPProtocol.h +++ b/libi2pd/I2NPProtocol.h @@ -319,7 +319,7 @@ namespace tunnel size_t GetI2NPMessageLength (const uint8_t * msg, size_t len); void HandleI2NPMessage (std::shared_ptr msg); - const uint64_t TUNNEL_BUILD_MESSAGES_MIN_INTERVAL = 100; // in milliseconds + const uint64_t TUNNEL_BUILD_MESSAGES_MIN_INTERVAL = 500; // in milliseconds const int MAX_NUM_THROTTLED_TUNNEL_BUILD_MESSAGES = 5; const int MAX_NUM_DROPPED_TUNNEL_BUILD_MESSAGES = 1000; class I2NPMessagesHandler