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

Function gossip_init

gossipd/gossipd.c:378–410  ·  view source on GitHub ↗

~ Parse init message from lightningd: starts the daemon properly. */

Source from the content-addressed store, hash-verified

376
377/*~ Parse init message from lightningd: starts the daemon properly. */
378static void gossip_init(struct daemon *daemon, const u8 *msg)
379{
380 if (!fromwire_gossipd_init(daemon, msg,
381 &chainparams,
382 &daemon->our_features,
383 &daemon->id,
384 &daemon->autoconnect_seeker_peers,
385 &daemon->compactd_helper,
386 &daemon->dev_fast_gossip,
387 &daemon->dev_fast_gossip_prune)) {
388 master_badmsg(WIRE_GOSSIPD_INIT, msg);
389 }
390
391 /* Gossmap manager starts up */
392 daemon->gm = gossmap_manage_new(daemon, daemon);
393
394 /* Fire up the seeker! */
395 daemon->seeker = new_seeker(daemon);
396
397 /* connectd is already started, and uses this fd to feed/recv gossip. */
398 daemon->connectd = daemon_conn_new(daemon, CONNECTD_FD,
399 connectd_req,
400 NULL, daemon);
401 tal_add_destructor(daemon->connectd, master_or_connectd_gone);
402
403 /* Tell it about all our local (public) channel_update messages,
404 * and node_announcement, so it doesn't unnecessarily regenerate them. */
405 gossmap_manage_tell_lightningd_locals(daemon, daemon->gm);
406
407 /* OK, we are ready. */
408 daemon_conn_send(daemon->master,
409 take(towire_gossipd_init_reply(NULL)));
410}
411
412static void new_blockheight(struct daemon *daemon, const u8 *msg)
413{

Callers 1

recv_reqFunction · 0.70

Calls 5

gossmap_manage_newFunction · 0.85
new_seekerFunction · 0.85
daemon_conn_sendFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected