From 8402541c73c0f2849fc98a215a3a49aa08c1c01a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 22 Dec 2022 20:17:09 +0100 Subject: [PATCH] Faster roaming path recovery for multiple interface non-transport instances --- RNS/Transport.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 678a46a..ec2b257 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -401,6 +401,11 @@ class Transport: if lr_taken_hops == 0 and time.time() - last_path_request > Transport.PATH_REQUEST_MI: RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[6])+" since an attempted link was never established", RNS.LOG_DEBUG) path_requests.append(link_entry[6]) + if not RNS.Reticulum.transport_enabled(): + # Drop current path if we are not a transport instance, to + # allow using higher-hop count paths or reused announces + # from newly adjacent transport instances. + Transport.expire_path(link_entry[6]) # Cull the path table stale_paths = [] @@ -562,9 +567,6 @@ class Transport: Transport.jobs_locked = True - # TODO: This updateHash call might be redundant - # packet.update_hash() - sent = False outbound_time = time.time()