From b06f5285c51664a9e85cbf43942e77a8f2139ce5 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 4 May 2024 20:27:04 +0200 Subject: [PATCH] Fix LR proof delivery on unknown hop count paths --- RNS/Transport.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 55450fb..12b211d 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -1746,7 +1746,19 @@ class Transport: # pending link for link in Transport.pending_links: if link.link_id == packet.destination_hash: - if packet.hops == link.expected_hops: + # We need to also allow an expected hops value of + # PATHFINDER_M, since in some cases, the number of hops + # to the destination will be unknown at link creation + # time. The real chance of this occuring is likely to be + # extremely small, and this allowance could probably + # be discarded without major issues, but it is kept + # for now to ensure backwards compatibility. + + # TODO: Probably reset check back to + # if packet.hops == link.expected_hops: + # within one of the next releases + + if packet.hops == link.expected_hops or link.expected_hops == RNS.Transport.PATHFINDER_M: # Add this packet to the filter hashlist if we # have determined that it's actually destined # for this system, and then validate the proof