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

Function lockin_complete

lightningd/channel_control.c:1106–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104}
1105
1106void lockin_complete(struct channel *channel,
1107 enum channel_state expected_state)
1108{
1109 if (!channel->scid &&
1110 (!channel->alias[REMOTE] || !channel->alias[LOCAL])) {
1111 log_debug(channel->log, "Attempted lockin, but neither scid "
1112 "nor aliases are set, ignoring");
1113 return;
1114 }
1115
1116 /* We set this once they're locked in. */
1117 assert(channel->remote_channel_ready);
1118
1119 /* We might have already started shutting down */
1120 if (channel->state != expected_state) {
1121 log_debug(channel->log, "Lockin complete, but state %s",
1122 channel_state_name(channel));
1123 return;
1124 }
1125
1126 channel_set_state(channel,
1127 expected_state,
1128 CHANNELD_NORMAL,
1129 REASON_UNKNOWN,
1130 "Lockin complete");
1131
1132 lockin_has_completed(channel, true);
1133}
1134
1135bool channel_on_channel_ready(struct channel *channel,
1136 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