From 5199f9e9cbf2fea21669b44aad02a164e2b9b30b Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Wed, 8 Nov 2023 14:25:03 -0700 Subject: [PATCH] fix: skip any multiaddrs that do not parse --- operator/src/network/ipfs_rpc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/src/network/ipfs_rpc.rs b/operator/src/network/ipfs_rpc.rs index 837fa825..baa18027 100644 --- a/operator/src/network/ipfs_rpc.rs +++ b/operator/src/network/ipfs_rpc.rs @@ -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::().ok()) .filter(|addr| { // Address must have both a non loopback ip4 address and a tcp or quic endpoint addr.iter().any(|proto| match proto {