summaryrefslogtreecommitdiff
path: root/toxcore/DHT.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-27 16:10:01 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-08-30 21:33:15 +0000
commita5cd4764aa3e5f8f0ba18d8348f5995d255f6c00 (patch)
tree1bb41adb2c1bf79f5ff3a20b762a3bd316ce1f5f /toxcore/DHT.h
parent515196dfa2097a9a9f04eeff5130860fc4137b0f (diff)
Clean up `add_to_list` function a bit.
Can't trivially get rid of recursion here, since it's a non-linear recursive function.
Diffstat (limited to 'toxcore/DHT.h')
-rw-r--r--toxcore/DHT.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/DHT.h b/toxcore/DHT.h
index 4a7af4c7..9f5f1ec7 100644
--- a/toxcore/DHT.h
+++ b/toxcore/DHT.h
@@ -302,9 +302,12 @@ int dht_getfriendip(const DHT *dht, const uint8_t *public_key, IP_Port *ip_port)
302 */ 302 */
303int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2); 303int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2);
304 304
305/* Add node to the node list making sure only the nodes closest to cmp_pk are in the list. 305/**
306 * Add node to the node list making sure only the nodes closest to cmp_pk are in the list.
307 *
308 * @return true iff the node was added to the list.
306 */ 309 */
307bool add_to_list(Node_format *nodes_list, unsigned int length, const uint8_t *pk, IP_Port ip_port, 310bool add_to_list(Node_format *nodes_list, uint32_t length, const uint8_t *pk, IP_Port ip_port,
308 const uint8_t *cmp_pk); 311 const uint8_t *cmp_pk);
309 312
310/* Return 1 if node can be added to close list, 0 if it can't. 313/* Return 1 if node can be added to close list, 0 if it can't.