summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-11-14 16:09:57 +0100
committerLinus Färnstrand <linus@mullvad.net>2018-11-14 17:59:47 +0100
commitc3d1a65d80d4b6063450110311a3f5677c61925e (patch)
tree0e948d31e073cff40a01c758562646cc7db68a92
parent840d8d4e2605999f1f7e3b88babeca6b04a1b5b1 (diff)
downloadmullvadvpn-c3d1a65d80d4b6063450110311a3f5677c61925e.tar.xz
mullvadvpn-c3d1a65d80d4b6063450110311a3f5677c61925e.zip
Filter out relays that have tunnel endpoints
Solves bug of Wireguard servers showing up in the GUI. Also solves potential future problems if the API supplies relays without any endpoints, they should not be selectable
-rw-r--r--mullvad-daemon/src/relays.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs
index de01883e58..74f071e487 100644
--- a/mullvad-daemon/src/relays.rs
+++ b/mullvad-daemon/src/relays.rs
@@ -70,6 +70,12 @@ impl ParsedRelays {
let city_code = city.code.clone();
let latitude = city.latitude;
let longitude = city.longitude;
+ city.relays = city
+ .relays
+ .iter()
+ .filter(|relay| !relay.tunnels.is_empty())
+ .cloned()
+ .collect();
for relay in &mut city.relays {
let mut relay_with_location = relay.clone();
relay_with_location.location = Some(Location {