Fixed big bug in DHT.

This commit is contained in:
irungentoo 2013-07-19 12:09:40 -04:00
parent 8a50c04725
commit 2d88476d44

View File

@ -206,7 +206,7 @@ int get_close_nodes(uint8_t * client_id, Node_format * nodes_list)
}
else for(k = 0; k < MAX_SENT_NODES; k++)
{
if(id_closest(client_id, nodes_list[k].client_id, friends_list[i].client_list[j].client_id) == 2)
if(id_closest(friends_list[i].client_id, nodes_list[k].client_id, friends_list[i].client_list[j].client_id) == 2)
{
memcpy(nodes_list[k].client_id, friends_list[i].client_list[j].client_id, CLIENT_ID_SIZE);
nodes_list[k].ip_port = friends_list[i].client_list[j].ip_port;