| 115 | } |
| 116 | |
| 117 | static void handle_init_cupdate(struct lightningd *ld, const u8 *msg) |
| 118 | { |
| 119 | struct short_channel_id scid; |
| 120 | u8 *update; |
| 121 | struct channel *channel; |
| 122 | |
| 123 | if (!fromwire_gossipd_init_cupdate(msg, msg, &scid, &update)) { |
| 124 | fatal("Gossip gave bad GOSSIPD_INIT_CUPDATE %s", |
| 125 | tal_hex(msg, msg)); |
| 126 | } |
| 127 | |
| 128 | channel = any_channel_by_scid(ld, scid, true); |
| 129 | if (!channel) { |
| 130 | log_broken(ld->log, "init_cupdate for unknown scid %s: telling gossipd it's spent", |
| 131 | fmt_short_channel_id(tmpctx, scid)); |
| 132 | /* Presumably gossipd missed that it was already spent, so |
| 133 | * tell it now! (We need a tal object for this, hence |
| 134 | * tal_dup) */ |
| 135 | gossipd_notify_spends(ld, ld->gossip_blockheight, |
| 136 | tal_dup(tmpctx, struct short_channel_id, &scid)); |
| 137 | return; |
| 138 | } |
| 139 | |
| 140 | channel_gossip_update_from_gossipd(channel, take(update)); |
| 141 | } |
| 142 | |
| 143 | static void handle_init_nannounce(struct lightningd *ld, const u8 *msg) |
| 144 | { |
no test coverage detected