We were informed by channeld that channel is ready (reached mindepth) */
| 243 | |
| 244 | /* We were informed by channeld that channel is ready (reached mindepth) */ |
| 245 | static void peer_got_channel_ready(struct channel *channel, const u8 *msg) |
| 246 | { |
| 247 | struct pubkey next_per_commitment_point; |
| 248 | struct short_channel_id *alias_remote; |
| 249 | |
| 250 | if (!fromwire_channeld_got_channel_ready(tmpctx, |
| 251 | msg, &next_per_commitment_point, &alias_remote)) { |
| 252 | channel_internal_error(channel, |
| 253 | "bad channel_got_channel_ready %s", |
| 254 | tal_hex(channel, msg)); |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | if (!channel_on_channel_ready(channel, &next_per_commitment_point)) |
| 259 | return; |
| 260 | |
| 261 | if (channel->alias[REMOTE] == NULL) |
| 262 | channel->alias[REMOTE] = tal_steal(channel, alias_remote); |
| 263 | |
| 264 | /* Remember that we got the lockin */ |
| 265 | wallet_channel_save(channel->peer->ld->wallet, channel); |
| 266 | |
| 267 | if (channel->depth >= channel->minimum_depth) |
| 268 | lockin_complete(channel); |
| 269 | } |
| 270 | |
| 271 | static void peer_got_announcement(struct channel *channel, const u8 *msg) |
| 272 | { |
no test coverage detected