| 186 | } |
| 187 | |
| 188 | static 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 | |
| 228 | bool channel_on_channel_ready(struct channel *channel, |
| 229 | struct pubkey *next_per_commitment_point) |
no test coverage detected