| 1268 | } |
| 1269 | |
| 1270 | static void handle_commit_signed(struct state *state, const u8 *msg) |
| 1271 | { |
| 1272 | struct bitcoin_tx *local_commit; |
| 1273 | struct bitcoin_signature remote_sig; |
| 1274 | struct tx_state *tx_state = state->tx_state; |
| 1275 | char *err; |
| 1276 | |
| 1277 | if (!state->reconnected) |
| 1278 | open_err_fatal(state, "Sent commit signed out of turn (not reconnect)" |
| 1279 | ": %s", tal_hex(msg, msg)); |
| 1280 | |
| 1281 | report_channel_hsmd(state, tx_state); |
| 1282 | err = do_commit_signed_received(tmpctx, msg, state, tx_state, |
| 1283 | &local_commit, &remote_sig); |
| 1284 | if (err) |
| 1285 | open_err_fatal(state, |
| 1286 | "They sent invalid commitment sig: %s", err); |
| 1287 | |
| 1288 | /* Send the commitment_signed to lightningd; will save to db */ |
| 1289 | peer_billboard(false, "channel open: commitment received, " |
| 1290 | "sending to lightningd to save"); |
| 1291 | |
| 1292 | /* FIXME: add pbase for first time commits? */ |
| 1293 | msg = towire_dualopend_commit_rcvd(state, |
| 1294 | local_commit, |
| 1295 | &remote_sig, |
| 1296 | NULL); |
| 1297 | wire_sync_write(REQ_FD, take(msg)); |
| 1298 | } |
| 1299 | |
| 1300 | static void handle_tx_sigs(struct state *state, const u8 *msg) |
| 1301 | { |
no test coverage detected