Skip to content

Commit 1a89f24

Browse files
committed
refactor: Explicitly pass dependencies to constructors.
Instead of transitively loading them from dependencies, we should be explicit about what each object needs. The downside of this is that it's not clear whether the object and its dependency use the same common dependency. The upside is that we don't expose those getters of internal dependencies.
1 parent 14804a4 commit 1a89f24

25 files changed

+110
-127
lines changed

auto_tests/announce_test.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
#include <string.h>
33

44
#include "../toxcore/announce.h"
5-
#include "../toxcore/tox.h"
6-
#include "../testing/misc_tools.h"
75
#include "../toxcore/mono_time.h"
86
#include "../toxcore/forwarding.h"
9-
#include "../toxcore/net_crypto.h"
10-
#include "../toxcore/util.h"
117
#include "auto_test_support.h"
128
#include "check_compat.h"
139

@@ -66,9 +62,9 @@ static void test_store_data(void)
6662
ck_assert(net != nullptr);
6763
DHT *dht = new_dht(log, mem, rng, ns, mono_time, net, true, true);
6864
ck_assert(dht != nullptr);
69-
Forwarding *forwarding = new_forwarding(log, mem, rng, mono_time, dht);
65+
Forwarding *forwarding = new_forwarding(log, mem, rng, mono_time, dht, net);
7066
ck_assert(forwarding != nullptr);
71-
Announcements *announce = new_announcements(log, mem, rng, mono_time, forwarding);
67+
Announcements *announce = new_announcements(log, mem, rng, mono_time, forwarding, dht, net);
7268
ck_assert(announce != nullptr);
7369

7470
/* Just to prevent CI from complaining that set_synch_offset is unused: */

auto_tests/forwarding_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "../toxcore/mono_time.h"
99
#include "../toxcore/forwarding.h"
1010
#include "../toxcore/net_crypto.h"
11-
#include "../toxcore/util.h"
1211
#include "auto_test_support.h"
1312
#include "check_compat.h"
1413

@@ -131,12 +130,12 @@ static Forwarding_Subtox *new_forwarding_subtox(const Memory *mem, bool no_udp,
131130
ck_assert(subtox->tcp_np != nullptr);
132131

133132
const TCP_Proxy_Info inf = {{{{0}}}};
134-
subtox->c = new_net_crypto(subtox->log, mem, rng, ns, subtox->mono_time, subtox->dht, &inf, subtox->tcp_np);
133+
subtox->c = new_net_crypto(subtox->log, mem, rng, ns, subtox->mono_time, subtox->net, subtox->dht, &inf, subtox->tcp_np);
135134

136-
subtox->forwarding = new_forwarding(subtox->log, mem, rng, subtox->mono_time, subtox->dht);
135+
subtox->forwarding = new_forwarding(subtox->log, mem, rng, subtox->mono_time, subtox->dht, subtox->net);
137136
ck_assert(subtox->forwarding != nullptr);
138137

139-
subtox->announce = new_announcements(subtox->log, mem, rng, subtox->mono_time, subtox->forwarding);
138+
subtox->announce = new_announcements(subtox->log, mem, rng, subtox->mono_time, subtox->forwarding, subtox->dht, subtox->net);
140139
ck_assert(subtox->announce != nullptr);
141140

142141
return subtox;

auto_tests/onion_test.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
#include "../testing/misc_tools.h"
55
#include "../toxcore/mono_time.h"
6+
#include "../toxcore/network.h"
67
#include "../toxcore/onion.h"
78
#include "../toxcore/onion_announce.h"
89
#include "../toxcore/onion_client.h"
9-
#include "../toxcore/util.h"
1010
#include "auto_test_support.h"
1111
#include "check_compat.h"
1212

@@ -237,8 +237,10 @@ static void test_basic(void)
237237
Mono_Time *mono_time2 = mono_time_new(mem, nullptr, nullptr);
238238

239239
IP ip = get_loopback();
240-
Onion *onion1 = new_onion(log1, mem, mono_time1, rng, new_dht(log1, mem, rng, ns, mono_time1, new_networking(log1, mem, ns, &ip, 36567), true, false));
241-
Onion *onion2 = new_onion(log2, mem, mono_time2, rng, new_dht(log2, mem, rng, ns, mono_time2, new_networking(log2, mem, ns, &ip, 36568), true, false));
240+
Networking_Core *net1 = new_networking(log1, mem, ns, &ip, 36567);
241+
Onion *onion1 = new_onion(log1, mem, mono_time1, rng, new_dht(log1, mem, rng, ns, mono_time1, net1, true, false), net1);
242+
Networking_Core *net2 = new_networking(log2, mem, ns, &ip, 36568);
243+
Onion *onion2 = new_onion(log2, mem, mono_time2, rng, new_dht(log2, mem, rng, ns, mono_time2, net2, true, false), net2);
242244
ck_assert_msg((onion1 != nullptr) && (onion2 != nullptr), "Onion failed initializing.");
243245
networking_registerhandler(onion2->net, NET_PACKET_ANNOUNCE_REQUEST, &handle_test_1, onion2);
244246

@@ -281,8 +283,8 @@ static void test_basic(void)
281283
do_onion(mono_time2, onion2);
282284
} while (handled_test_2 == 0);
283285

284-
Onion_Announce *onion1_a = new_onion_announce(log1, mem, rng, mono_time1, onion1->dht);
285-
Onion_Announce *onion2_a = new_onion_announce(log2, mem, rng, mono_time2, onion2->dht);
286+
Onion_Announce *onion1_a = new_onion_announce(log1, mem, rng, mono_time1, onion1->dht, onion1->net);
287+
Onion_Announce *onion2_a = new_onion_announce(log2, mem, rng, mono_time2, onion2->dht, onion2->net);
286288
networking_registerhandler(onion1->net, NET_PACKET_ANNOUNCE_RESPONSE, &handle_test_3, onion1);
287289
networking_registerhandler(onion1->net, NET_PACKET_ANNOUNCE_RESPONSE_OLD, &handle_test_3_old, onion1);
288290
ck_assert_msg((onion1_a != nullptr) && (onion2_a != nullptr), "Onion_Announce failed initializing.");
@@ -334,7 +336,8 @@ static void test_basic(void)
334336

335337
Mono_Time *mono_time3 = mono_time_new(mem, nullptr, nullptr);
336338

337-
Onion *onion3 = new_onion(log3, mem, mono_time3, rng, new_dht(log3, mem, rng, ns, mono_time3, new_networking(log3, mem, ns, &ip, 36569), true, false));
339+
Networking_Core *net3 = new_networking(log3, mem, ns, &ip, 36569);
340+
Onion *onion3 = new_onion(log3, mem, mono_time3, rng, new_dht(log3, mem, rng, ns, mono_time3, net3, true, false), net3);
338341
ck_assert_msg((onion3 != nullptr), "Onion failed initializing.");
339342

340343
random_nonce(rng, nonce);
@@ -359,7 +362,7 @@ static void test_basic(void)
359362
{
360363
Onion *onion = onion3;
361364

362-
Networking_Core *net = dht_get_net(onion->dht);
365+
Networking_Core *net = onion->net;
363366
DHT *dht = onion->dht;
364367
kill_onion(onion);
365368
kill_dht(dht);
@@ -371,7 +374,7 @@ static void test_basic(void)
371374
{
372375
Onion *onion = onion2;
373376

374-
Networking_Core *net = dht_get_net(onion->dht);
377+
Networking_Core *net = onion->net;
375378
DHT *dht = onion->dht;
376379
kill_onion(onion);
377380
kill_dht(dht);
@@ -383,7 +386,7 @@ static void test_basic(void)
383386
{
384387
Onion *onion = onion1;
385388

386-
Networking_Core *net = dht_get_net(onion->dht);
389+
Networking_Core *net = onion->net;
387390
DHT *dht = onion->dht;
388391
kill_onion(onion);
389392
kill_dht(dht);
@@ -396,6 +399,7 @@ static void test_basic(void)
396399
typedef struct {
397400
Logger *log;
398401
Mono_Time *mono_time;
402+
Net_Crypto *nc;
399403
Net_Profile *tcp_np;
400404
Onion *onion;
401405
Onion_Announce *onion_a;
@@ -449,7 +453,7 @@ static Onions *new_onions(const Memory *mem, const Random *rng, uint16_t port, u
449453
return nullptr;
450454
}
451455

452-
on->onion = new_onion(on->log, mem, on->mono_time, rng, dht);
456+
on->onion = new_onion(on->log, mem, on->mono_time, rng, dht, net);
453457

454458
if (!on->onion) {
455459
kill_dht(dht);
@@ -460,7 +464,7 @@ static Onions *new_onions(const Memory *mem, const Random *rng, uint16_t port, u
460464
return nullptr;
461465
}
462466

463-
on->onion_a = new_onion_announce(on->log, mem, rng, on->mono_time, dht);
467+
on->onion_a = new_onion_announce(on->log, mem, rng, on->mono_time, dht, net);
464468

465469
if (!on->onion_a) {
466470
kill_onion(on->onion);
@@ -486,7 +490,8 @@ static Onions *new_onions(const Memory *mem, const Random *rng, uint16_t port, u
486490
}
487491

488492
TCP_Proxy_Info inf = {{{{0}}}};
489-
on->onion_c = new_onion_client(on->log, mem, rng, on->mono_time, new_net_crypto(on->log, mem, rng, ns, on->mono_time, dht, &inf, on->tcp_np));
493+
on->nc = new_net_crypto(on->log, mem, rng, ns, on->mono_time, net, dht, &inf, on->tcp_np);
494+
on->onion_c = new_onion_client(on->log, mem, rng, on->mono_time, on->nc, dht, net);
490495

491496
if (!on->onion_c) {
492497
netprof_kill(mem, on->tcp_np);
@@ -514,9 +519,9 @@ static void do_onions(Onions *on)
514519

515520
static void kill_onions(const Memory *mem, Onions *on)
516521
{
517-
Networking_Core *net = dht_get_net(on->onion->dht);
522+
Networking_Core *net = on->onion->net;
518523
DHT *dht = on->onion->dht;
519-
Net_Crypto *c = onion_get_net_crypto(on->onion_c);
524+
Net_Crypto *c = on->nc;
520525
kill_onion_client(on->onion_c);
521526
kill_onion_announce(on->onion_a);
522527
kill_onion(on->onion);
@@ -640,9 +645,9 @@ static void test_announce(void)
640645

641646
printf("adding friend\n");
642647
int frnum_f = onion_addfriend(onions[NUM_FIRST]->onion_c,
643-
nc_get_self_public_key(onion_get_net_crypto(onions[NUM_LAST]->onion_c)));
648+
nc_get_self_public_key(onions[NUM_LAST]->nc));
644649
int frnum = onion_addfriend(onions[NUM_LAST]->onion_c,
645-
nc_get_self_public_key(onion_get_net_crypto(onions[NUM_FIRST]->onion_c)));
650+
nc_get_self_public_key(onions[NUM_FIRST]->nc));
646651

647652
onion_dht_pk_callback(onions[NUM_FIRST]->onion_c, frnum_f, &dht_pk_callback, onions[NUM_FIRST], NUM_FIRST);
648653
onion_dht_pk_callback(onions[NUM_LAST]->onion_c, frnum, &dht_pk_callback, onions[NUM_LAST], NUM_LAST);

other/DHT_bootstrap.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ int main(int argc, char *argv[])
157157
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);
158158
const uint16_t start_port = PORT;
159159
const uint16_t end_port = start_port + (TOX_PORTRANGE_TO - TOX_PORTRANGE_FROM);
160-
DHT *dht = new_dht(logger, mem, rng, ns, mono_time, new_networking_ex(logger, mem, ns, &ip, start_port, end_port, nullptr), true, true);
161-
Onion *onion = new_onion(logger, mem, mono_time, rng, dht);
162-
Forwarding *forwarding = new_forwarding(logger, mem, rng, mono_time, dht);
160+
Networking_Core *net = new_networking_ex(logger, mem, ns, &ip, start_port, end_port, nullptr);
161+
DHT *dht = new_dht(logger, mem, rng, ns, mono_time, net, true, true);
162+
Onion *onion = new_onion(logger, mem, mono_time, rng, dht, net);
163+
Forwarding *forwarding = new_forwarding(logger, mem, rng, mono_time, dht, net);
163164
GC_Announces_List *gc_announces_list = new_gca_list(mem);
164-
Onion_Announce *onion_a = new_onion_announce(logger, mem, rng, mono_time, dht);
165+
Onion_Announce *onion_a = new_onion_announce(logger, mem, rng, mono_time, dht, net);
165166

166167
#ifdef DHT_NODE_EXTRA_PACKETS
167-
bootstrap_set_callbacks(dht_get_net(dht), (uint32_t)DAEMON_VERSION_NUMBER, (const uint8_t *) motd_str, strlen(motd_str) + 1);
168+
bootstrap_set_callbacks(net, (uint32_t)DAEMON_VERSION_NUMBER, (const uint8_t *) motd_str, strlen(motd_str) + 1);
168169
#endif
169170

170171
if (onion == nullptr || forwarding == nullptr || onion_a == nullptr) {
@@ -214,7 +215,7 @@ int main(int argc, char *argv[])
214215
fclose(file);
215216

216217
printf("\n");
217-
printf("Port: %u\n", net_ntohs(net_port(dht_get_net(dht))));
218+
printf("Port: %u\n", net_ntohs(net_port(net)));
218219

219220
if (argc > argvoffset + 3) {
220221
printf("Trying to bootstrap into the network...\n");
@@ -258,7 +259,7 @@ int main(int argc, char *argv[])
258259
do_dht(dht);
259260

260261
if (mono_time_is_timeout(mono_time, last_lan_discovery, is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL)) {
261-
lan_discovery_send(dht_get_net(dht), broadcast, dht_get_self_public_key(dht), net_htons(PORT));
262+
lan_discovery_send(net, broadcast, dht_get_self_public_key(dht), net_htons(PORT));
262263
last_lan_discovery = mono_time_get(mono_time);
263264
}
264265

@@ -267,7 +268,7 @@ int main(int argc, char *argv[])
267268
#ifdef TCP_RELAY_ENABLED
268269
do_tcp_server(tcp_s, mono_time);
269270
#endif
270-
networking_poll(dht_get_net(dht), nullptr);
271+
networking_poll(net, nullptr);
271272

272273
c_sleep(1);
273274
}

other/bootstrap_daemon/src/tox-bootstrapd.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ int main(int argc, char *argv[])
348348
return 1;
349349
}
350350

351-
Forwarding *forwarding = new_forwarding(logger, mem, rng, mono_time, dht);
351+
Forwarding *forwarding = new_forwarding(logger, mem, rng, mono_time, dht, net);
352352

353353
if (forwarding == nullptr) {
354354
log_write(LOG_LEVEL_ERROR, "Couldn't initialize forwarding. Exiting.\n");
@@ -362,7 +362,7 @@ int main(int argc, char *argv[])
362362
return 1;
363363
}
364364

365-
Announcements *announce = new_announcements(logger, mem, rng, mono_time, forwarding);
365+
Announcements *announce = new_announcements(logger, mem, rng, mono_time, forwarding, dht, net);
366366

367367
if (announce == nullptr) {
368368
log_write(LOG_LEVEL_ERROR, "Couldn't initialize DHT announcements. Exiting.\n");
@@ -393,7 +393,7 @@ int main(int argc, char *argv[])
393393
return 1;
394394
}
395395

396-
Onion *onion = new_onion(logger, mem, mono_time, rng, dht);
396+
Onion *onion = new_onion(logger, mem, mono_time, rng, dht, net);
397397

398398
if (onion == nullptr) {
399399
log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox Onion. Exiting.\n");
@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
410410
return 1;
411411
}
412412

413-
Onion_Announce *onion_a = new_onion_announce(logger, mem, rng, mono_time, dht);
413+
Onion_Announce *onion_a = new_onion_announce(logger, mem, rng, mono_time, dht, net);
414414

415415
if (onion_a == nullptr) {
416416
log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox Onion Announce. Exiting.\n");
@@ -431,7 +431,7 @@ int main(int argc, char *argv[])
431431
gca_onion_init(group_announce, onion_a);
432432

433433
if (enable_motd) {
434-
if (bootstrap_set_callbacks(dht_get_net(dht), DAEMON_VERSION_NUMBER, (uint8_t *)motd, strlen(motd) + 1) == 0) {
434+
if (bootstrap_set_callbacks(net, DAEMON_VERSION_NUMBER, (uint8_t *)motd, strlen(motd) + 1) == 0) {
435435
log_write(LOG_LEVEL_INFO, "Set MOTD successfully.\n");
436436
free(motd);
437437
} else {
@@ -591,7 +591,7 @@ int main(int argc, char *argv[])
591591
do_dht(dht);
592592

593593
if (enable_lan_discovery && mono_time_is_timeout(mono_time, last_lan_discovery, LAN_DISCOVERY_INTERVAL)) {
594-
lan_discovery_send(dht_get_net(dht), broadcast, dht_get_self_public_key(dht), net_htons_port);
594+
lan_discovery_send(net, broadcast, dht_get_self_public_key(dht), net_htons_port);
595595
last_lan_discovery = mono_time_get(mono_time);
596596
}
597597

@@ -601,7 +601,7 @@ int main(int argc, char *argv[])
601601
do_tcp_server(tcp_server, mono_time);
602602
}
603603

604-
networking_poll(dht_get_net(dht), nullptr);
604+
networking_poll(net, nullptr);
605605

606606
if (waiting_for_dht_connection && dht_isconnected(dht)) {
607607
log_write(LOG_LEVEL_INFO, "Connected to another bootstrap node successfully.\n");

toxcore/DHT.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "shared_key_cache.h"
2626
#include "sort.h"
2727
#include "state.h"
28-
#include "util.h"
2928

3029
/** The timeout after which a node is discarded completely. */
3130
#define KILL_NODE_TIMEOUT (BAD_NODE_TIMEOUT + PING_INTERVAL)
@@ -161,10 +160,6 @@ void dht_set_self_secret_key(DHT *dht, const uint8_t *key)
161160
memcpy(dht->self_secret_key, key, CRYPTO_SECRET_KEY_SIZE);
162161
}
163162

164-
Networking_Core *dht_get_net(const DHT *dht)
165-
{
166-
return dht->net;
167-
}
168163
struct Ping *dht_get_ping(const DHT *dht)
169164
{
170165
return dht->ping;
@@ -2509,7 +2504,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw
25092504
dht->hole_punching_enabled = hole_punching_enabled;
25102505
dht->lan_discovery_enabled = lan_discovery_enabled;
25112506

2512-
dht->ping = ping_new(mem, mono_time, rng, dht);
2507+
dht->ping = ping_new(mem, mono_time, rng, dht, net);
25132508

25142509
if (dht->ping == nullptr) {
25152510
LOGGER_ERROR(log, "failed to initialise ping");

toxcore/DHT.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ const uint8_t *_Nonnull dht_get_self_secret_key(const DHT *_Nonnull dht);
222222
void dht_set_self_public_key(DHT *_Nonnull dht, const uint8_t *_Nonnull key);
223223
void dht_set_self_secret_key(DHT *_Nonnull dht, const uint8_t *_Nonnull key);
224224

225-
Networking_Core *_Nonnull dht_get_net(const DHT *_Nonnull dht);
226225
struct Ping *_Nonnull dht_get_ping(const DHT *_Nonnull dht);
227226
const Client_data *_Nonnull dht_get_close_clientlist(const DHT *_Nonnull dht);
228227
const Client_data *_Nonnull dht_get_close_client(const DHT *_Nonnull dht, uint32_t client_num);

toxcore/Messenger.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random *
34433443
return nullptr;
34443444
}
34453445

3446-
m->net_crypto = new_net_crypto(m->log, m->mem, m->rng, m->ns, m->mono_time, m->dht, &options->proxy_info, m->tcp_np);
3446+
m->net_crypto = new_net_crypto(m->log, m->mem, m->rng, m->ns, m->mono_time, m->net, m->dht, &options->proxy_info, m->tcp_np);
34473447

34483448
if (m->net_crypto == nullptr) {
34493449
LOGGER_WARNING(m->log, "net_crypto initialisation failed");
@@ -3473,9 +3473,9 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random *
34733473
}
34743474

34753475
if (options->dht_announcements_enabled) {
3476-
m->forwarding = new_forwarding(m->log, m->mem, m->rng, m->mono_time, m->dht);
3476+
m->forwarding = new_forwarding(m->log, m->mem, m->rng, m->mono_time, m->dht, m->net);
34773477
if (m->forwarding != nullptr) {
3478-
m->announce = new_announcements(m->log, m->mem, m->rng, m->mono_time, m->forwarding);
3478+
m->announce = new_announcements(m->log, m->mem, m->rng, m->mono_time, m->forwarding, m->dht, m->net);
34793479
} else {
34803480
m->announce = nullptr;
34813481
}
@@ -3484,11 +3484,11 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random *
34843484
m->announce = nullptr;
34853485
}
34863486

3487-
m->onion = new_onion(m->log, m->mem, m->mono_time, m->rng, m->dht);
3488-
m->onion_a = new_onion_announce(m->log, m->mem, m->rng, m->mono_time, m->dht);
3489-
m->onion_c = new_onion_client(m->log, m->mem, m->rng, m->mono_time, m->net_crypto);
3487+
m->onion = new_onion(m->log, m->mem, m->mono_time, m->rng, m->dht, m->net);
3488+
m->onion_a = new_onion_announce(m->log, m->mem, m->rng, m->mono_time, m->dht, m->net);
3489+
m->onion_c = new_onion_client(m->log, m->mem, m->rng, m->mono_time, m->net_crypto, m->dht, m->net);
34903490
if (m->onion_c != nullptr) {
3491-
m->fr_c = new_friend_connections(m->log, m->mem, m->mono_time, m->ns, m->onion_c, options->local_discovery_enabled);
3491+
m->fr_c = new_friend_connections(m->log, m->mem, m->mono_time, m->ns, m->onion_c, m->dht, m->net_crypto, m->net, options->local_discovery_enabled);
34923492
}
34933493

34943494
if ((options->dht_announcements_enabled && (m->forwarding == nullptr || m->announce == nullptr)) ||

toxcore/announce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static int handle_dht_announce_request(
613613
}
614614

615615
Announcements *new_announcements(const Logger *log, const Memory *mem, const Random *rng, const Mono_Time *mono_time,
616-
Forwarding *forwarding)
616+
Forwarding *forwarding, DHT *dht, Networking_Core *net)
617617
{
618618
if (log == nullptr || mono_time == nullptr || forwarding == nullptr) {
619619
return nullptr;
@@ -630,8 +630,8 @@ Announcements *new_announcements(const Logger *log, const Memory *mem, const Ran
630630
announce->rng = rng;
631631
announce->forwarding = forwarding;
632632
announce->mono_time = mono_time;
633-
announce->dht = forwarding_get_dht(forwarding);
634-
announce->net = dht_get_net(announce->dht);
633+
announce->dht = dht;
634+
announce->net = net;
635635
announce->public_key = dht_get_self_public_key(announce->dht);
636636
announce->secret_key = dht_get_self_secret_key(announce->dht);
637637
new_hmac_key(announce->rng, announce->hmac_key);

0 commit comments

Comments
 (0)