MCPcopy Create free account
hub / github.com/ElementsProject/lightning / new_daemon

Function new_daemon

tests/fuzz/fuzz-handle_onion_message.c:37–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37static struct daemon *new_daemon(const tal_t *ctx)
38{
39 struct daemon *daemon = talz(ctx, struct daemon);
40
41 daemon->our_features = tal(ctx, struct feature_set);
42 daemon->our_features->bits[NODE_ANNOUNCE_FEATURE] = tal_arr(ctx, u8, 0);
43 set_feature_bit(&daemon->our_features->bits[NODE_ANNOUNCE_FEATURE], OPT_ONION_MESSAGES);
44
45 daemon->scid_htable = tal(ctx, struct scid_htable);
46 scid_htable_init(daemon->scid_htable);
47
48 daemon->peers = tal(ctx, struct peer_htable);
49 peer_htable_init(daemon->peers);
50
51 memset(&daemon->mykey, 'a', sizeof(daemon->mykey));
52 node_id_from_pubkey(&daemon->id, &daemon->mykey);
53
54 daemon->master = daemon_conn_new(ctx, lightningd_fd, NULL, NULL, daemon);
55
56 return daemon;
57}
58
59void init(int *argc, char ***argv)
60{

Callers 1

runFunction · 0.85

Calls 2

set_feature_bitFunction · 0.85
node_id_from_pubkeyFunction · 0.85

Tested by

no test coverage detected