aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-18 12:41:46 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-18 12:41:46 +0200
commitb32a799c76b5f033437c96add3f196dc29e9acb4 (patch)
treeca87634955005cc536ebc8fb85b3b619709707f9 /src/util.rs
parent238c0162c0036f767dbf5672f8856def754625a3 (diff)
downloadnetapp-b32a799c76b5f033437c96add3f196dc29e9acb4.tar.gz
netapp-b32a799c76b5f033437c96add3f196dc29e9acb4.zip
Return None when no IPs could be resolved
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs3
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))
}