Skip to content

Commit

Permalink
Add log statement for denied incoming connection
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Oct 5, 2023
1 parent 9edb0ab commit d054d46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rust-peer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ async fn main() -> Result<()> {
SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
warn!("Failed to dial {peer_id:?}: {error}");
}
SwarmEvent::IncomingConnectionError { error, .. } => {
warn!("{:#}", anyhow::Error::from(error))
}
SwarmEvent::ConnectionClosed { peer_id, cause, .. } => {
warn!("Connection to {peer_id} closed: {cause:?}");
swarm.behaviour_mut().kademlia.remove_peer(&peer_id);
Expand Down

0 comments on commit d054d46

Please sign in to comment.