From 7e56ae40fd995fbdf4fda60532839cdd3c2b11db Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 12 Dec 2015 14:50:25 -0500 Subject: Small onion search improvement. --- toxcore/onion_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 2bbe420e..d6d078e1 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -597,7 +597,9 @@ static int client_ping_nodes(Onion_Client *onion_c, uint32_t num, const Node_for continue; if (is_timeout(list_nodes[0].timestamp, ONION_NODE_TIMEOUT) - || id_closest(reference_id, list_nodes[0].public_key, nodes[i].public_key) == 2) { + || id_closest(reference_id, list_nodes[0].public_key, nodes[i].public_key) == 2 + || is_timeout(list_nodes[1].timestamp, ONION_NODE_TIMEOUT) + || id_closest(reference_id, list_nodes[1].public_key, nodes[i].public_key) == 2 ) { /* check if node is already in list. */ for (j = 0; j < list_length; ++j) { if (memcmp(list_nodes[j].public_key, nodes[i].public_key, crypto_box_PUBLICKEYBYTES) == 0) { -- cgit v1.2.3