diff options
Diffstat (limited to 'src/peering/fullmesh.rs')
-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); } } |