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

Function peer_got_channel_ready

lightningd/channel_control.c:1236–1259  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1234
1235/* We were informed by channeld that channel is ready (reached mindepth) */
1236static void peer_got_channel_ready(struct channel *channel, const u8 *msg)
1237{
1238 struct pubkey next_per_commitment_point;
1239 struct short_channel_id *alias_remote;
1240
1241 if (!fromwire_channeld_got_channel_ready(tmpctx,
1242 msg, &next_per_commitment_point, &alias_remote)) {
1243 channel_internal_error(channel,
1244 "bad channel_got_channel_ready %s",
1245 tal_hex(channel, msg));
1246 return;
1247 }
1248
1249 if (!channel_on_channel_ready(channel,
1250 &next_per_commitment_point,
1251 alias_remote))
1252 return;
1253
1254 /* Remember that we got the lockin */
1255 wallet_channel_save(channel->peer->ld->wallet, channel);
1256
1257 if (channel->depth >= channel->minimum_depth)
1258 lockin_complete(channel, CHANNELD_AWAITING_LOCKIN);
1259}
1260
1261static void peer_got_announcement(struct channel *channel, const u8 *msg)
1262{

Callers 1

channel_msgFunction · 0.85

Calls 5

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

Tested by

no test coverage detected