summaryrefslogtreecommitdiff
path: root/core/DHT.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-19 12:35:52 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-19 12:35:52 -0400
commitc657778f0ce7c14d37717547037b6b1f46cd9fe6 (patch)
tree4b888a1e90d2fde520b2e61da12da2b5d34f1437 /core/DHT.c
parent2d88476d44216b7032bdddf19cf8eba38b7f6705 (diff)
The last fix was wrong, this time it's properly fixed.
Diffstat (limited to 'core/DHT.c')
-rw-r--r--core/DHT.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/DHT.c b/core/DHT.c
index 232bf1e1..0d8145d1 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -206,7 +206,7 @@ int get_close_nodes(uint8_t * client_id, Node_format * nodes_list)
206 } 206 }
207 else for(k = 0; k < MAX_SENT_NODES; k++) 207 else for(k = 0; k < MAX_SENT_NODES; k++)
208 { 208 {
209 if(id_closest(friends_list[i].client_id, nodes_list[k].client_id, friends_list[i].client_list[j].client_id) == 2) 209 if(id_closest(client_id, nodes_list[k].client_id, friends_list[i].client_list[j].client_id) == 2)
210 { 210 {
211 memcpy(nodes_list[k].client_id, friends_list[i].client_list[j].client_id, CLIENT_ID_SIZE); 211 memcpy(nodes_list[k].client_id, friends_list[i].client_list[j].client_id, CLIENT_ID_SIZE);
212 nodes_list[k].ip_port = friends_list[i].client_list[j].ip_port; 212 nodes_list[k].ip_port = friends_list[i].client_list[j].ip_port;
@@ -288,7 +288,7 @@ void addto_lists(IP_Port ip_port, uint8_t * client_id)
288 if(replace_bad(friends_list[i].client_list, MAX_FRIEND_CLIENTS, client_id, ip_port)) 288 if(replace_bad(friends_list[i].client_list, MAX_FRIEND_CLIENTS, client_id, ip_port))
289 { 289 {
290 //if we can't replace bad nodes we try replacing good ones 290 //if we can't replace bad nodes we try replacing good ones
291 replace_good(friends_list[i].client_list, MAX_FRIEND_CLIENTS, client_id, ip_port, self_public_key); 291 replace_good(friends_list[i].client_list, MAX_FRIEND_CLIENTS, client_id, ip_port, friends_list[i].client_id);
292 } 292 }
293 } 293 }
294 } 294 }