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

Function peer_got_channel_ready

lightningd/channel_control.c:245–269  ·  view source on GitHub ↗

We were informed by channeld that channel is ready (reached mindepth) */

Source from the content-addressed store, hash-verified

243
244/* We were informed by channeld that channel is ready (reached mindepth) */
245static 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
271static void peer_got_announcement(struct channel *channel, const u8 *msg)
272{

Callers 1

channel_msgFunction · 0.85

Calls 5

tal_hexFunction · 0.85
channel_on_channel_readyFunction · 0.85
lockin_completeFunction · 0.85
channel_internal_errorFunction · 0.70
wallet_channel_saveFunction · 0.50

Tested by

no test coverage detected