diff options
author | Alex Auvolat <alex@adnab.me> | 2021-10-18 12:41:46 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-10-18 12:41:46 +0200 |
commit | b32a799c76b5f033437c96add3f196dc29e9acb4 (patch) | |
tree | ca87634955005cc536ebc8fb85b3b619709707f9 | |
parent | 238c0162c0036f767dbf5672f8856def754625a3 (diff) | |
download | netapp-b32a799c76b5f033437c96add3f196dc29e9acb4.tar.gz netapp-b32a799c76b5f033437c96add3f196dc29e9acb4.zip |
Return None when no IPs could be resolved
-rw-r--r-- | src/util.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.rs b/src/util.rs index 4f6e352..047095f 100644 --- a/src/util.rs +++ b/src/util.rs @@ -84,5 +84,8 @@ pub fn parse_and_resolve_peer_addr(peer: &str) -> Option<(NodeID, Vec<SocketAddr .to_socket_addrs() .ok()? .collect::<Vec<_>>(); + if hosts.is_empty() { + return None; + } Some((pubkey, hosts)) } |