| 1340 | } |
| 1341 | |
| 1342 | static void handle_commit_signed(struct state *state, const u8 *msg) |
| 1343 | { |
| 1344 | struct bitcoin_tx *local_commit; |
| 1345 | struct bitcoin_signature remote_sig; |
| 1346 | struct tx_state *tx_state = state->tx_state; |
| 1347 | char *err; |
| 1348 | |
| 1349 | if (!state->reconnected) |
| 1350 | open_err_fatal(state, "Sent commit signed out of turn (not reconnect)" |
| 1351 | ": %s", tal_hex(msg, msg)); |
| 1352 | |
| 1353 | report_channel_hsmd(state, tx_state); |
| 1354 | err = do_commit_signed_received(tmpctx, msg, state, tx_state, |
| 1355 | &local_commit, &remote_sig); |
| 1356 | if (err) |
| 1357 | open_err_fatal(state, |
| 1358 | "They sent invalid commitment sig: %s", err); |
| 1359 | |
| 1360 | /* Send the commitment_signed to lightningd; will save to db */ |
| 1361 | peer_billboard(false, "channel open: commitment received, " |
| 1362 | "sending to lightningd to save"); |
| 1363 | |
| 1364 | /* FIXME: add pbase for first time commits? */ |
| 1365 | msg = towire_dualopend_commit_rcvd(state, |
| 1366 | local_commit, |
| 1367 | &remote_sig, |
| 1368 | NULL); |
| 1369 | wire_sync_write(REQ_FD, take(msg)); |
| 1370 | } |
| 1371 | |
| 1372 | static void handle_tx_sigs(struct state *state, const u8 *msg) |
| 1373 | { |
no test coverage detected