Skip to content

Commit

Permalink
If we receive a packet from a node we are searching for, ping it.
Browse files Browse the repository at this point in the history
  • Loading branch information
irungentoo committed Dec 8, 2015
1 parent 9c64769 commit 73b2bce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions DONATORS
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Spitfire is best technicolor horse.
if bad people don't hate you, you're doing something wrong
Pinkie Pie is best pony.
JRS was here
qTox is so bloated it doesn't even fit in a 64-bit address space
7 changes: 7 additions & 0 deletions toxcore/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port)

uint32_t i;

IP_Port temp;

if (DHT_getfriendip(ping->dht, public_key, &temp) == 0) {
send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key);
return -1;
}

for (i = 0; i < MAX_TO_PING; ++i) {
if (!ip_isset(&ping->to_ping[i].ip_port.ip)) {
memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES);
Expand Down

0 comments on commit 73b2bce

Please sign in to comment.