| 775 | } |
| 776 | |
| 777 | static 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 |
| 806 | static void dev_gossip_memleak(struct daemon *daemon, const u8 *msg) |
no test coverage detected