diff options
-rw-r--r-- | core/DHT.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -633,6 +633,8 @@ static int handle_sendnodes(IP_Port source, uint8_t * packet, uint32_t length) | |||
633 | 633 | ||
634 | int DHT_addfriend(uint8_t * client_id) | 634 | int DHT_addfriend(uint8_t * client_id) |
635 | { | 635 | { |
636 | if(friend_number(client_id) != -1) /*Is friend already in DHT?*/ | ||
637 | return 1; | ||
636 | Friend * temp; | 638 | Friend * temp; |
637 | temp = realloc(friends_list, sizeof(Friend) * (num_friends + 1)); | 639 | temp = realloc(friends_list, sizeof(Friend) * (num_friends + 1)); |
638 | if (temp == NULL) | 640 | if (temp == NULL) |