| 410 | } |
| 411 | |
| 412 | static 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 | |
| 440 | static void dev_gossip_memleak(struct daemon *daemon, const u8 *msg) |
| 441 | { |
no test coverage detected