From 08bfd923ea45cd1c2b0628f6ac96f2ee2a8866a9 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 5 Aug 2023 15:10:00 +0200 Subject: [PATCH] Fixed possible invalid comparison in link watchdog job --- RNS/Link.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RNS/Link.py b/RNS/Link.py index 1e27f46..c02335a 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -510,7 +510,11 @@ class Link: def __watchdog_job(self): while not self.status == Link.CLOSED: while (self.watchdog_lock): - sleep(max(self.rtt, 0.025)) + rtt_wait = 0.025 + if hasattr(self, "rtt") and self.rtt: + rtt_wait = self.rtt + + sleep(max(rtt_wait, 0.025)) if not self.status == Link.CLOSED: # Link was initiated, but no response