diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index bd40de13..d3a56af7 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -1834,15 +1834,12 @@ void do_onion_client(Onion_Client *onion_c) } } - bool udp_connected = dht_non_lan_connected(onion_c->dht); + onion_c->udp_connected = dht_non_lan_connected(onion_c->dht); if (mono_time_is_timeout(onion_c->mono_time, onion_c->first_run, ONION_CONNECTION_SECONDS * 2)) { - set_tcp_onion_status(nc_get_tcp_c(onion_c->c), !udp_connected); + set_tcp_onion_status(nc_get_tcp_c(onion_c->c), !onion_c->udp_connected); } - onion_c->udp_connected = udp_connected - || get_random_tcp_onion_conn_number(nc_get_tcp_c(onion_c->c)) == -1; /* Check if connected to any TCP relays. */ - if (onion_connection_status(onion_c)) { for (unsigned i = 0; i < onion_c->num_friends; ++i) { do_friend(onion_c, i);