We make sure gossipd is started before plugins (which may want gossip_map) */
| 270 | |
| 271 | /* We make sure gossipd is started before plugins (which may want gossip_map) */ |
| 272 | static 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 */ |
nothing calls this directly
no test coverage detected