From d5c005f02462b996c067d7ed4f1ef71bbd4e5dd2 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Fri, 31 Jan 2014 20:25:46 -0500 Subject: [PATCH] Fixed error in last commit. The tests actually work. --- toxcore/onion_client.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 7cba27a9..93697c28 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -775,17 +775,17 @@ static void do_friend(Onion_Client *onion_c, uint16_t friendnum) for (i = 0; i < num_nodes; ++i) client_send_announce_request(onion_c, friendnum + 1, nodes_list[i].ip_port, nodes_list[i].client_id, 0); } - - - /* send packets to friend telling them our fake DHT id. */ - if (is_timeout(onion_c->friends_list[friendnum].last_fakeid_onion_sent, ONION_FAKEID_INTERVAL)) - if (send_fakeid_announce(onion_c, friendnum, 0) >= 1) - onion_c->friends_list[friendnum].last_fakeid_onion_sent = unix_time(); - - if (is_timeout(onion_c->friends_list[friendnum].last_fakeid_dht_sent, DHT_FAKEID_INTERVAL)) - if (send_fakeid_announce(onion_c, friendnum, 1) >= 1) - onion_c->friends_list[friendnum].last_fakeid_dht_sent = unix_time(); } + + /* send packets to friend telling them our fake DHT id. */ + if (is_timeout(onion_c->friends_list[friendnum].last_fakeid_onion_sent, ONION_FAKEID_INTERVAL)) + if (send_fakeid_announce(onion_c, friendnum, 0) >= 1) + onion_c->friends_list[friendnum].last_fakeid_onion_sent = unix_time(); + + if (is_timeout(onion_c->friends_list[friendnum].last_fakeid_dht_sent, DHT_FAKEID_INTERVAL)) + if (send_fakeid_announce(onion_c, friendnum, 1) >= 1) + onion_c->friends_list[friendnum].last_fakeid_dht_sent = unix_time(); + } } /* Function to call when onion data packet with contents beginning with byte is received. */