| 1154 | } |
| 1155 | |
| 1156 | void 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 | |
| 1185 | bool channel_on_channel_ready(struct channel *channel, |
| 1186 | const struct pubkey *next_per_commitment_point, |
no test coverage detected