diff options
author | irungentoo <irungentoo@gmail.com> | 2015-12-12 14:50:25 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-12-12 14:50:25 -0500 |
commit | 7e56ae40fd995fbdf4fda60532839cdd3c2b11db (patch) | |
tree | 0525386d83a6715239038c66262631c93b1df055 | |
parent | 07a6f482d9e799c3b0f04fc435cfad9a969028fb (diff) |
Small onion search improvement.
-rw-r--r-- | toxcore/onion_client.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 | |||
597 | continue; | 597 | continue; |
598 | 598 | ||
599 | if (is_timeout(list_nodes[0].timestamp, ONION_NODE_TIMEOUT) | 599 | if (is_timeout(list_nodes[0].timestamp, ONION_NODE_TIMEOUT) |
600 | || id_closest(reference_id, list_nodes[0].public_key, nodes[i].public_key) == 2) { | 600 | || id_closest(reference_id, list_nodes[0].public_key, nodes[i].public_key) == 2 |
601 | || is_timeout(list_nodes[1].timestamp, ONION_NODE_TIMEOUT) | ||
602 | || id_closest(reference_id, list_nodes[1].public_key, nodes[i].public_key) == 2 ) { | ||
601 | /* check if node is already in list. */ | 603 | /* check if node is already in list. */ |
602 | for (j = 0; j < list_length; ++j) { | 604 | for (j = 0; j < list_length; ++j) { |
603 | if (memcmp(list_nodes[j].public_key, nodes[i].public_key, crypto_box_PUBLICKEYBYTES) == 0) { | 605 | if (memcmp(list_nodes[j].public_key, nodes[i].public_key, crypto_box_PUBLICKEYBYTES) == 0) { |