diff options
author | Alex Auvolat <alex@adnab.me> | 2021-10-21 12:33:35 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-10-21 12:33:35 +0200 |
commit | 57327f10e2536a89004f3a1def83ed16243c1a3e (patch) | |
tree | 6bdc94d6d3f81ef15f0ba82b3c13d8ff91eb8665 /src | |
parent | d15378a2245b30fa2094c95bd942c94361f06c4c (diff) | |
download | netapp-57327f10e2536a89004f3a1def83ed16243c1a3e.tar.gz netapp-57327f10e2536a89004f3a1def83ed16243c1a3e.zip |
fix again
Diffstat (limited to 'src')
-rw-r--r-- | src/peering/fullmesh.rs | 11 |
1 files 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); } } |