mirror of
https://github.com/markqvist/Reticulum
synced 2026-11-27 13:52:15 +00:00
Transport: fix pending_links items removal while being iterated
This commit is contained in:
1 parent
0c41027765
commit
90ac62620d
1 file changed
+4
-1
+4
-1
@@ -532,6 +532,7 @@ class Transport:
|
||||
if time.time() > Transport.links_last_checked+Transport.links_check_interval:
|
||||
|
||||
with Transport.pending_links_lock:
|
||||
closed_pending_links = []
|
||||
for link in Transport.pending_links:
|
||||
if link.status == RNS.Link.CLOSED:
|
||||
# If we are not a Transport Instance, finding a pending link
|
||||
@@ -555,7 +556,9 @@ class Transport:
|
||||
blocked_if = None
|
||||
path_requests[link.destination.hash] = blocked_if
|
||||
|
||||
Transport.pending_links.remove(link)
|
||||
closed_pending_links.append(link)
|
||||
|
||||
for closed_link in closed_pending_links: Transport.pending_links.remove(closed_link)
|
||||
|
||||
with Transport.active_links_lock:
|
||||
closed_links = []
|
||||
|
||||
Reference in new issue
Block a user