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

Function lockin_complete

lightningd/channel_control.c:1156–1183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154}
1155
1156void lockin_complete(struct channel *channel,
1157 enum channel_state expected_state)
1158{
1159 if (!channel->scid &&
1160 (!channel->alias[REMOTE] || !channel->alias[LOCAL])) {
1161 log_debug(channel->log, "Attempted lockin, but neither scid "
1162 "nor aliases are set, ignoring");
1163 return;
1164 }
1165
1166 /* We set this once they're locked in. */
1167 assert(channel->remote_channel_ready);
1168
1169 /* We might have already started shutting down */
1170 if (channel->state != expected_state) {
1171 log_debug(channel->log, "Lockin complete, but state %s",
1172 channel_state_name(channel));
1173 return;
1174 }
1175
1176 channel_set_state(channel,
1177 expected_state,
1178 CHANNELD_NORMAL,
1179 REASON_UNKNOWN,
1180 "Lockin complete");
1181
1182 lockin_has_completed(channel, true);
1183}
1184
1185bool channel_on_channel_ready(struct channel *channel,
1186 const struct pubkey *next_per_commitment_point,

Callers 3

funding_depth_cbFunction · 0.70
peer_got_channel_readyFunction · 0.70

Calls 3

channel_set_stateFunction · 0.85
lockin_has_completedFunction · 0.85
channel_state_nameFunction · 0.70

Tested by

no test coverage detected