aboutsummaryrefslogtreecommitdiff
path: root/src/peering
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-21 12:33:35 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-21 12:33:35 +0200
commit57327f10e2536a89004f3a1def83ed16243c1a3e (patch)
tree6bdc94d6d3f81ef15f0ba82b3c13d8ff91eb8665 /src/peering
parentd15378a2245b30fa2094c95bd942c94361f06c4c (diff)
downloadnetapp-57327f10e2536a89004f3a1def83ed16243c1a3e.tar.gz
netapp-57327f10e2536a89004f3a1def83ed16243c1a3e.zip
fix again
Diffstat (limited to 'src/peering')
-rw-r--r--src/peering/fullmesh.rs11
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);
}
}