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

Function new_blockheight

gossipd/gossipd.c:777–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777static void new_blockheight(struct daemon *daemon, const u8 *msg)
778{
779 if (!fromwire_gossipd_new_blockheight(msg, &daemon->current_blockheight))
780 master_badmsg(WIRE_GOSSIPD_NEW_BLOCKHEIGHT, msg);
781
782 /* Check if we can now send any deferred queries. */
783 for (size_t i = 0; i < tal_count(daemon->deferred_txouts); i++) {
784 const struct short_channel_id *scid
785 = &daemon->deferred_txouts[i];
786
787 if (!is_scid_depth_announceable(scid,
788 daemon->current_blockheight))
789 continue;
790
791 /* short_channel_id is deep enough, now ask about it. */
792 daemon_conn_send(daemon->master,
793 take(towire_gossipd_get_txout(NULL, scid)));
794
795 tal_arr_remove(&daemon->deferred_txouts, i);
796 i--;
797 }
798
799 routing_expire_channels(daemon->rstate, daemon->current_blockheight);
800
801 daemon_conn_send(daemon->master,
802 take(towire_gossipd_new_blockheight_reply(NULL)));
803}
804
805#if DEVELOPER
806static void dev_gossip_memleak(struct daemon *daemon, const u8 *msg)

Callers 1

recv_reqFunction · 0.85

Calls 4

routing_expire_channelsFunction · 0.85
master_badmsgFunction · 0.50
daemon_conn_sendFunction · 0.50

Tested by

no test coverage detected