Skip to content
Snippets Groups Projects
Commit 02d68086 authored by Moul's avatar Moul
Browse files

[mod] #265: check nodes are unique with endpoints.

parent f066475a
No related branches found
No related tags found
No related merge requests found
......@@ -270,14 +270,14 @@ class Network(QObject):
def _check_nodes_unique(self):
"""
Check that all nodes are unique by them pubkeys
Check that all nodes are unique by they endpoints
"""
pubkeys = set()
endpoints = set()
unique_nodes = []
for n in self.nodes:
if n.pubkey not in pubkeys:
if n.endpoint not in endpoints:
unique_nodes.append(n)
pubkeys.add(n.pubkey)
endpoints.add(n.endpoint)
self._nodes = unique_nodes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment