From 5909a13ba417733d14c3f88b79f7ec60faa8cbbf Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 14 Aug 2013 10:26:02 -0400 Subject: Add friend now fails if it already is in DHT. --- core/DHT.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core') diff --git a/core/DHT.c b/core/DHT.c index d359076d..5eae147c 100644 --- a/core/DHT.c +++ b/core/DHT.c @@ -633,6 +633,8 @@ static int handle_sendnodes(IP_Port source, uint8_t * packet, uint32_t length) int DHT_addfriend(uint8_t * client_id) { + if(friend_number(client_id) != -1) /*Is friend already in DHT?*/ + return 1; Friend * temp; temp = realloc(friends_list, sizeof(Friend) * (num_friends + 1)); if (temp == NULL) -- cgit v1.2.3