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

Function lockin_complete

lightningd/channel_control.c:188–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static void lockin_complete(struct channel *channel)
189{
190 if (!channel->scid &&
191 (!channel->alias[REMOTE] || !channel->alias[LOCAL])) {
192 log_debug(channel->log, "Attempted lockin, but neither scid "
193 "nor aliases are set, ignoring");
194 return;
195 }
196
197 /* We set this once they're locked in. */
198 assert(channel->remote_channel_ready);
199
200 /* We might have already started shutting down */
201 if (channel->state != CHANNELD_AWAITING_LOCKIN) {
202 log_debug(channel->log, "Lockin complete, but state %s",
203 channel_state_name(channel));
204 return;
205 }
206
207 channel_set_state(channel,
208 CHANNELD_AWAITING_LOCKIN,
209 CHANNELD_NORMAL,
210 REASON_UNKNOWN,
211 "Lockin complete");
212
213 /* Fees might have changed (and we use IMMEDIATE once we're funded),
214 * so update now. */
215 try_update_feerates(channel->peer->ld, channel);
216
217 try_update_blockheight(channel->peer->ld, channel,
218 get_block_height(channel->peer->ld->topology));
219
220 /* Emit an event for the channel open (or channel proposal if blockheight
221 * is zero) */
222 channel_record_open(channel,
223 channel->scid ?
224 short_channel_id_blocknum(channel->scid) : 0,
225 true);
226}
227
228bool channel_on_channel_ready(struct channel *channel,
229 struct pubkey *next_per_commitment_point)

Callers 2

peer_got_channel_readyFunction · 0.85
channel_tell_depthFunction · 0.85

Calls 7

channel_set_stateFunction · 0.85
try_update_feeratesFunction · 0.85
try_update_blockheightFunction · 0.85
channel_record_openFunction · 0.85
channel_state_nameFunction · 0.70
get_block_heightFunction · 0.70

Tested by

no test coverage detected