From b5cb3a65dd4e398f536d5accb83982ddf40d372a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 30 Sep 2023 00:25:47 +0200 Subject: [PATCH] Fixed announce queue not clearing all announces with exceeded retry limit at the same time --- RNS/Transport.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 648ca42..8099f4d 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -352,12 +352,12 @@ class Transport: # Process announces needing retransmission if time.time() > Transport.announces_last_checked+Transport.announces_check_interval: + completed_announces = [] for destination_hash in Transport.announce_table: announce_entry = Transport.announce_table[destination_hash] if announce_entry[2] > Transport.PATHFINDER_R: RNS.log("Completed announce processing for "+RNS.prettyhexrep(destination_hash)+", retry limit reached", RNS.LOG_EXTREME) - Transport.announce_table.pop(destination_hash) - break + completed_announces.append(destination_hash) else: if time.time() > announce_entry[1]: announce_entry[1] = time.time() + Transport.PATHFINDER_G + Transport.PATHFINDER_RW @@ -404,6 +404,10 @@ class Transport: Transport.announce_table[destination_hash] = held_entry RNS.log("Reinserting held announce into table", RNS.LOG_DEBUG) + for destination_hash in completed_announces: + if destination_hash in Transport.announce_table: + Transport.announce_table.pop(destination_hash) + Transport.announces_last_checked = time.time()