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

Function new_blockheight

gossipd/gossipd.c:412–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412static void new_blockheight(struct daemon *daemon, const u8 *msg)
413{
414 if (!fromwire_gossipd_new_blockheight(msg, &daemon->current_blockheight))
415 master_badmsg(WIRE_GOSSIPD_NEW_BLOCKHEIGHT, msg);
416
417 /* Check if we can now send any deferred queries. */
418 for (size_t i = 0; i < tal_count(daemon->deferred_txouts); i++) {
419 const struct short_channel_id scid
420 = daemon->deferred_txouts[i];
421
422 if (!is_scid_depth_announceable(scid,
423 daemon->current_blockheight))
424 continue;
425
426 /* short_channel_id is deep enough, now ask about it. */
427 daemon_conn_send(daemon->master,
428 take(towire_gossipd_get_txout(NULL, scid)));
429
430 tal_arr_remove(&daemon->deferred_txouts, i);
431 i--;
432 }
433
434 gossmap_manage_new_block(daemon->gm, daemon->current_blockheight);
435
436 daemon_conn_send(daemon->master,
437 take(towire_gossipd_new_blockheight_reply(NULL)));
438}
439
440static void dev_gossip_memleak(struct daemon *daemon, const u8 *msg)
441{

Callers 1

recv_reqFunction · 0.70

Calls 4

daemon_conn_sendFunction · 0.85
gossmap_manage_new_blockFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected