From 781cb4712d958dc58ffeafd00bffde71d92f7f31 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 28 Aug 2021 23:53:51 +0200 Subject: [PATCH] Fixed request packet receipts timing out in spite of delivery. --- RNS/Packet.py | 2 +- RNS/Transport.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RNS/Packet.py b/RNS/Packet.py index 09588a7..23ba622 100755 --- a/RNS/Packet.py +++ b/RNS/Packet.py @@ -440,7 +440,7 @@ class PacketReceipt: return (self.sent_at+self.timeout < time.time()) def check_timeout(self): - if self.is_timed_out(): + if self.status == PacketReceipt.SENT and self.is_timed_out(): if self.timeout == -1: self.status = PacketReceipt.CULLED else: diff --git a/RNS/Transport.py b/RNS/Transport.py index a400a78..91d6881 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -864,6 +864,9 @@ class Transport: if receipt.hash == proof_hash: receipt_validated = receipt.validate_proof_packet(packet) else: + # TODO: This looks like it should actually + # be rewritten when implicit proofs are added. + # In case of an implicit proof, we have # to check every single outstanding receipt receipt_validated = receipt.validate_proof_packet(packet)