Skip to content

Commit ad228fb

Browse files
committed
Copy list structures on persist
1 parent a61b20a commit ad228fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

RNS/Transport.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ def save_packet_hashlist():
27942794

27952795
packet_hashlist_path = RNS.Reticulum.storagepath+"/packet_hashlist"
27962796
file = open(packet_hashlist_path, "wb")
2797-
file.write(umsgpack.packb(list(Transport.packet_hashlist)))
2797+
file.write(umsgpack.packb(list(Transport.packet_hashlist.copy())))
27982798
file.close()
27992799

28002800
save_time = time.time() - save_start
@@ -2829,7 +2829,7 @@ def save_path_table():
28292829
RNS.log("Saving path table to storage...", RNS.LOG_DEBUG)
28302830

28312831
serialised_destinations = []
2832-
for destination_hash in Transport.destination_table:
2832+
for destination_hash in Transport.destination_table.copy():
28332833
# Get the destination entry from the destination table
28342834
de = Transport.destination_table[destination_hash]
28352835
interface_hash = de[5].get_hash()
@@ -2899,10 +2899,10 @@ def save_tunnel_table():
28992899
RNS.log("Saving tunnel table to storage...", RNS.LOG_DEBUG)
29002900

29012901
serialised_tunnels = []
2902-
for tunnel_id in Transport.tunnels:
2902+
for tunnel_id in Transport.tunnels.copy():
29032903
te = Transport.tunnels[tunnel_id]
29042904
interface = te[1]
2905-
tunnel_paths = te[2]
2905+
tunnel_paths = te[2].copy()
29062906
expires = te[3]
29072907

29082908
if interface != None:

0 commit comments

Comments
 (0)