Return None when no IPs could be resolved

This commit is contained in:
Alex 2021-10-18 12:41:46 +02:00
parent 238c0162c0
commit b32a799c76
No known key found for this signature in database
GPG key ID: EDABF9711E244EB1

View file

@ -84,5 +84,8 @@ pub fn parse_and_resolve_peer_addr(peer: &str) -> Option<(NodeID, Vec<SocketAddr
.to_socket_addrs() .to_socket_addrs()
.ok()? .ok()?
.collect::<Vec<_>>(); .collect::<Vec<_>>();
if hosts.is_empty() {
return None;
}
Some((pubkey, hosts)) Some((pubkey, hosts))
} }