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

Function gossipd_init_done

lightningd/gossip_control.c:272–300  ·  view source on GitHub ↗

We make sure gossipd is started before plugins (which may want gossip_map) */

Source from the content-addressed store, hash-verified

270
271/* We make sure gossipd is started before plugins (which may want gossip_map) */
272static void gossipd_init_done(struct subd *gossipd,
273 const u8 *msg,
274 const int *fds,
275 void *unused)
276{
277 struct lightningd *ld = gossipd->ld;
278 u32 oldspends;
279
280 /* Any channels without channel_updates, we populate now: gossipd
281 * might have lost its gossip_store. */
282 channel_gossip_init_done(ld);
283
284 /* Tell it about any closures it might have missed! */
285 oldspends = wallet_utxoset_oldest_spentheight(tmpctx, ld->wallet);
286 if (oldspends) {
287 while (oldspends <= get_block_height(ld->topology)) {
288 const struct short_channel_id *scids;
289
290 scids = wallet_utxoset_get_spent(tmpctx, ld->wallet,
291 oldspends);
292 gossipd_notify_spends(ld, oldspends, scids);
293 oldspends++;
294 }
295 }
296
297 /* Break out of loop, so we can begin */
298 log_debug(gossipd->ld->log, "io_break: %s", __func__);
299 io_break(gossipd);
300}
301
302/* Create the `gossipd` subdaemon and send the initialization
303 * message */

Callers

nothing calls this directly

Calls 6

channel_gossip_init_doneFunction · 0.85
wallet_utxoset_get_spentFunction · 0.85
gossipd_notify_spendsFunction · 0.85
io_breakFunction · 0.85
get_block_heightFunction · 0.70

Tested by

no test coverage detected