Fix last-advert selection logic for path recency

This commit is contained in:
Jack Kingsman
2026-03-13 22:11:02 -07:00
parent b4962d39f0
commit 5512f9e677
2 changed files with 51 additions and 2 deletions
+2 -2
View File
@@ -442,8 +442,8 @@ async def _process_advertisement(
PATH_FRESHNESS_SECONDS = 60
use_existing_path = False
if existing and existing.last_seen:
path_age = timestamp - existing.last_seen
if existing and existing.last_advert:
path_age = timestamp - existing.last_advert
existing_path_len = existing.last_path_len if existing.last_path_len >= 0 else float("inf")
# Keep existing path if it's fresh and shorter (or equal)