Skip to content

Commit

Permalink
fix(dht/connectivity): only remove connection handles on connect, not…
Browse files Browse the repository at this point in the history
… right after refreshing neighbour pool
  • Loading branch information
sdbondi committed Sep 2, 2022
1 parent bf9d2e8 commit f4648dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ impl CommandContext {
format!(
"{}hnd: {}, ss: {}, rpc: {}",
chain_height.map(|s| format!("{}, ", s)).unwrap_or_default(),
conn.handle_count(),
// Exclude the handle held by list-connections
conn.handle_count().saturating_sub(1),
conn.substream_count(),
rpc_sessions
),
Expand Down
5 changes: 0 additions & 5 deletions comms/dht/src/connectivity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,6 @@ impl DhtConnectivity {
self.insert_neighbour(peer);
});

// Drop any connection handles that removed from the neighbour pool
difference.iter().for_each(|peer| {
self.remove_connection_handle(peer);
});

if !new_neighbours.is_empty() {
self.connectivity.request_many_dials(new_neighbours).await?;
}
Expand Down

0 comments on commit f4648dd

Please sign in to comment.