Skip to content

Commit

Permalink
Don't reset propagation node address and links if already set to the …
Browse files Browse the repository at this point in the history
…same destination
  • Loading branch information
markqvist committed Oct 5, 2024
1 parent 19d8909 commit 0178fb0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions LXMF/LXMRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ def set_outbound_propagation_node(self, destination_hash):
if len(destination_hash) != RNS.Identity.TRUNCATED_HASHLENGTH//8 or type(destination_hash) != bytes:
raise ValueError("Invalid destination hash for outbound propagation node")
else:
self.outbound_propagation_node = destination_hash
if self.outbound_propagation_link != None:
if self.outbound_propagation_link.destination.hash != destination_hash:
self.outbound_propagation_link.teardown()
self.outbound_propagation_link = None
if self.outbound_propagation_node != destination_hash:
self.outbound_propagation_node = destination_hash
if self.outbound_propagation_link != None:
if self.outbound_propagation_link.destination.hash != destination_hash:
self.outbound_propagation_link.teardown()
self.outbound_propagation_link = None

def get_outbound_propagation_node(self):
return self.outbound_propagation_node
Expand Down

0 comments on commit 0178fb0

Please sign in to comment.