Skip to content

Commit 73b2bce

Browse files
committed
If we receive a packet from a node we are searching for, ping it.
1 parent 9c64769 commit 73b2bce

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

DONATORS

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Spitfire is best technicolor horse.
44
if bad people don't hate you, you're doing something wrong
55
Pinkie Pie is best pony.
66
JRS was here
7+
qTox is so bloated it doesn't even fit in a 64-bit address space

toxcore/ping.c

+7
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port)
267267

268268
uint32_t i;
269269

270+
IP_Port temp;
271+
272+
if (DHT_getfriendip(ping->dht, public_key, &temp) == 0) {
273+
send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key);
274+
return -1;
275+
}
276+
270277
for (i = 0; i < MAX_TO_PING; ++i) {
271278
if (!ip_isset(&ping->to_ping[i].ip_port.ip)) {
272279
memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES);

0 commit comments

Comments
 (0)