Skip to content

Commit

Permalink
fix: skip any multiaddrs that do not parse
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc authored and smrz2001 committed Nov 8, 2023
1 parent e06fd5b commit 84d838d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion operator/src/network/ipfs_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl IpfsRpcClient for HttpRpcClient {
let p2p_addrs = data
.addresses
.iter()
.map(|addr| -> Multiaddr { addr.parse().expect("should be a valid multiaddr") })
.filter_map(|addr| addr.parse::<Multiaddr>().ok())
.filter(|addr| {
// Address must have both a non loopback ip4 address and a tcp or quic endpoint
addr.iter().any(|proto| match proto {
Expand Down

0 comments on commit 84d838d

Please sign in to comment.