Skip to content

Commit

Permalink
rust-client: debug log when addr parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 committed Dec 12, 2022
1 parent a3f23cd commit 5ad4f38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rust-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use libp2p::swarm::{
};
use libp2p::{dcutr, identify, identity, noise, ping, quic, tcp};
use libp2p::{PeerId, Transport};
use log::{info, warn};
use log::{debug, info, warn};
use std::collections::HashSet;
use std::convert::TryInto;
use std::env;
Expand Down Expand Up @@ -139,7 +139,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.multi_addresses
.clone()
.into_iter()
.filter_map(|a| Multiaddr::try_from(a).ok())
.filter_map(|addr| match Multiaddr::try_from(addr.clone()) {
Ok(a) => Some(a),
Err(e) => {
debug!("Filtering out invalid remote addr {addr:?}: {e}");
None
}
})
.collect::<Vec<_>>();

let state = HolePunchState::new(
Expand Down

0 comments on commit 5ad4f38

Please sign in to comment.