Break peering when peer moves outside auto-peering range

This commit is contained in:
Mark Qvist committed 2025-10-30 17:03:05 +01:00
1 parent 81a6d503a3
commit 6446db4f11
1 file changed
+5
+5
View File
@@ -74,6 +74,11 @@ class LXMFPropagationAnnounceHandler:
propagation_stamp_cost_flexibility=propagation_stamp_cost_flexibility,
metadata=metadata)
else:
if destination_hash in self.lxmrouter.peers:
RNS.log(f"Peer {self.lxmrouter.peers[destination_hash]} moved outside auto-peering range, breaking peering...")
self.lxmrouter.unpeer(destination_hash, node_timebase)
elif propagation_enabled == False:
self.lxmrouter.unpeer(destination_hash, node_timebase)