This commit is contained in:
fix 2021-08-31 23:24:31 +02:00
parent cbb744e468
commit 42c71a201d

View File

@ -72,6 +72,9 @@ def _create_node(
)
# TODO this should take a graph / adjacency list as argument and set peers based on that.
# currently all nodes are connected to all other nodes, which scales with O(n!) and
# takes significant amounts of time and compute for even small n < 10.
def _connect_nodes(nodes: Dict[str, MeshNodeConfig]) -> None:
for src, dst in itertools.permutations(nodes.keys(), 2):
nodes[dst].peers.append(nodes[src])