Skip to content

Commit

Permalink
Copy list structures on persist
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Feb 17, 2025
1 parent a61b20a commit ad228fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RNS/Transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -2794,7 +2794,7 @@ def save_packet_hashlist():

packet_hashlist_path = RNS.Reticulum.storagepath+"/packet_hashlist"
file = open(packet_hashlist_path, "wb")
file.write(umsgpack.packb(list(Transport.packet_hashlist)))
file.write(umsgpack.packb(list(Transport.packet_hashlist.copy())))
file.close()

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

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

serialised_tunnels = []
for tunnel_id in Transport.tunnels:
for tunnel_id in Transport.tunnels.copy():
te = Transport.tunnels[tunnel_id]
interface = te[1]
tunnel_paths = te[2]
tunnel_paths = te[2].copy()
expires = te[3]

if interface != None:
Expand Down

0 comments on commit ad228fb

Please sign in to comment.