Skip to content

Commit

Permalink
review comments: add comment explaining pool
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Mar 7, 2023
1 parent c8f496a commit 608da1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comms/core/src/connectivity/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ impl ConnectivityManagerActor {
},
}
match self.pool.get(&node_id) {
// The connection pool may temporarily contain a connection that is not connected so we need to check this.
Some(state) if state.is_connected() => {
if let Some(reply_tx) = reply_tx {
let _result = reply_tx.send(Ok(state.connection().cloned().expect("Already checked")));
Expand All @@ -323,7 +324,7 @@ impl ConnectivityManagerActor {
maybe_state => {
info!(
target: LOG_TARGET,
"No connection found for peer (status={}) `{}`. Dialing...",
"Connection is not connected (status={}) `{}`. Dialing...",
maybe_state
.map(|s| s.status().to_string())
.unwrap_or_else(|| "NotConnected".to_string()),
Expand Down

0 comments on commit 608da1f

Please sign in to comment.