From e5d39c984ba408cec023ee20a0d3e85715ccca43 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 23 Feb 2026 17:57:20 -0400 Subject: [PATCH] v1.2.24 - Fix: run ip_ban maintenance unconditionally every 60s regardless of max_connection_seconds setting --- src/main.h | 4 ++-- src/websockets.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main.h b/src/main.h index 79c5642..712b5e4 100644 --- a/src/main.h +++ b/src/main.h @@ -13,8 +13,8 @@ // Using CRELAY_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define CRELAY_VERSION_MAJOR 1 #define CRELAY_VERSION_MINOR 2 -#define CRELAY_VERSION_PATCH 23 -#define CRELAY_VERSION "v1.2.23" +#define CRELAY_VERSION_PATCH 24 +#define CRELAY_VERSION "v1.2.24" // Relay metadata (authoritative source for NIP-11 information) #define RELAY_NAME "C-Relay" diff --git a/src/websockets.c b/src/websockets.c index bbd2ee1..f12036d 100644 --- a/src/websockets.c +++ b/src/websockets.c @@ -2489,11 +2489,17 @@ int start_websocket_relay(int port_override, int strict_port) { } } - // Check connection age limits (every 60 seconds) + // Check connection age limits and run IP ban maintenance (every 60 seconds) int max_connection_seconds = get_config_int("max_connection_seconds", 86400); - if (max_connection_seconds > 0 && (current_time - last_connection_age_check >= 60)) { + if (current_time - last_connection_age_check >= 60) { last_connection_age_check = current_time; - check_connection_age(max_connection_seconds); + if (max_connection_seconds > 0) { + check_connection_age(max_connection_seconds); + } else { + // Even when connection age limit is disabled, run IP ban maintenance + ip_ban_cleanup(); + ip_ban_log_stats(); + } } }