From f61a6d6c8c93c9eae615f86975941a82610e8dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B8nstantine=20Kovalensky?= <45331093+kovalensky@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:16:11 +0400 Subject: [PATCH] Fix bypassing cache if IP changed while using cache (#1109) --- bt/announce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bt/announce.php b/bt/announce.php index 5e155c3a4..508036723 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -144,7 +144,7 @@ if ($stopped && $lp_info) { // Drop fast announce if ($lp_info && (!isset($event) || !$stopped)) { - if ($lp_info['ip_ver4'] === $ipv4 || $lp_info['ip_ver6'] === $ipv6) { + if ($lp_info['ip_ver4'] === $ipv4 || $lp_info['ip_ver6'] === $ipv6 || isset($lp_info['ip_ver4'], $lp_info['ip_ver6'])) { if ($lp_cached_peers = CACHE('tr_cache')->get(PEERS_LIST_PREFIX . $lp_info['topic_id'])) { drop_fast_announce($lp_info, $lp_cached_peers); // Use cache but with new calculated interval and seed, peer count set }