summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-14 10:26:02 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-14 10:26:02 -0400
commit5909a13ba417733d14c3f88b79f7ec60faa8cbbf (patch)
tree9dd92ca3126f37458e0d396df803a3795d171d2c /core
parent8eb8fb2ab5f703388be8987fd6b2cdf9dbc567e9 (diff)
Add friend now fails if it already is in DHT.
Diffstat (limited to 'core')
-rw-r--r--core/DHT.c2
1 files changed, 2 insertions, 0 deletions
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)
633 633
634int DHT_addfriend(uint8_t * client_id) 634int 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)