From 1542c5f4fe4956e29906dd59a9c95f5606910334 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 11 May 2023 16:22:44 +0200 Subject: [PATCH] Fixed received link packet proofs not resetting watchdog stale timer --- RNS/Link.py | 4 +++- RNS/Packet.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RNS/Link.py b/RNS/Link.py index 493de47..eba7394 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -148,6 +148,7 @@ class Link: self.pending_requests = [] self.last_inbound = 0 self.last_outbound = 0 + self.last_proof = 0 self.tx = 0 self.rx = 0 self.txbytes = 0 @@ -277,6 +278,7 @@ class Link: self.__remote_identity = self.destination.identity self.status = Link.ACTIVE self.activated_at = time.time() + self.last_proof = self.activated_at RNS.Transport.activate_link(self) RNS.log("Link "+str(self)+" established with "+str(self.destination)+", RTT is "+str(round(self.rtt, 3))+"s", RNS.LOG_VERBOSE) @@ -527,7 +529,7 @@ class Link: elif self.status == Link.ACTIVE: activated_at = self.activated_at if self.activated_at != None else 0 - last_inbound = max(self.last_inbound, activated_at) + last_inbound = max(max(self.last_inbound, self.last_proof), activated_at) if time.time() >= last_inbound + self.keepalive: if self.initiator: diff --git a/RNS/Packet.py b/RNS/Packet.py index d773a72..7a82d64 100755 --- a/RNS/Packet.py +++ b/RNS/Packet.py @@ -400,6 +400,7 @@ class PacketReceipt: self.proved = True self.concluded_at = time.time() self.proof_packet = proof_packet + link.last_proof = self.concluded_at if self.callbacks.delivery != None: try: