| 1104 | } |
| 1105 | |
| 1106 | void 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 | |
| 1135 | bool channel_on_channel_ready(struct channel *channel, |
| 1136 | const struct pubkey *next_per_commitment_point, |
no test coverage detected