From 57327f10e2536a89004f3a1def83ed16243c1a3e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 21 Oct 2021 12:33:35 +0200 Subject: [PATCH] fix again --- src/peering/fullmesh.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/peering/fullmesh.rs b/src/peering/fullmesh.rs index 068055e..04318a3 100644 --- a/src/peering/fullmesh.rs +++ b/src/peering/fullmesh.rs @@ -445,9 +445,16 @@ impl FullMeshPeeringStrategy { if let Some(host) = known_hosts.list.get_mut(&id) { host.state = PeerConnState::Connected; host.addr = addr; - known_hosts.update_hash(); - self.update_public_peer_list(&known_hosts); + } else { + known_hosts.list.insert(id, PeerInfoInternal{ + state: PeerConnState::Connected, + addr, + last_seen: None, + ping: VecDeque::new(), + }); } + known_hosts.update_hash(); + self.update_public_peer_list(&known_hosts); } }