| 1390 | } |
| 1391 | |
| 1392 | static void handle_send_tx_sigs(struct state *state, const u8 *msg) |
| 1393 | { |
| 1394 | struct wally_psbt *psbt; |
| 1395 | struct bitcoin_txid txid; |
| 1396 | struct tx_state *tx_state = state->tx_state; |
| 1397 | |
| 1398 | if (!fromwire_dualopend_send_tx_sigs(tmpctx, msg, &psbt)) |
| 1399 | master_badmsg(WIRE_DUALOPEND_SEND_TX_SIGS, msg); |
| 1400 | |
| 1401 | /* Check that we've got the same / correct PSBT */ |
| 1402 | psbt_txid(NULL, psbt, &txid, NULL); |
| 1403 | if (!bitcoin_txid_eq(&txid, &tx_state->funding.txid)) |
| 1404 | status_failed(STATUS_FAIL_INTERNAL_ERROR, |
| 1405 | "TXID for passed in PSBT does not match" |
| 1406 | " funding txid for channel. Expected %s, " |
| 1407 | "received %s", |
| 1408 | fmt_bitcoin_txid(tmpctx, |
| 1409 | &tx_state->funding.txid), |
| 1410 | fmt_bitcoin_txid(tmpctx, |
| 1411 | &txid)); |
| 1412 | |
| 1413 | tal_wally_start(); |
| 1414 | if (wally_psbt_combine(tx_state->psbt, psbt) != WALLY_OK) { |
| 1415 | tal_wally_end(tal_free(tx_state->psbt)); |
| 1416 | status_failed(STATUS_FAIL_INTERNAL_ERROR, |
| 1417 | "Unable to combine PSBTs. received %s\n" |
| 1418 | "local %s", |
| 1419 | fmt_wally_psbt(tmpctx, |
| 1420 | psbt), |
| 1421 | fmt_wally_psbt(tmpctx, |
| 1422 | tx_state->psbt)); |
| 1423 | } |
| 1424 | tal_wally_end(tx_state->psbt); |
| 1425 | |
| 1426 | /* Send our sigs to peer */ |
| 1427 | msg = psbt_to_tx_sigs_msg(tmpctx, state, tx_state->psbt); |
| 1428 | peer_write(state->pps, take(msg)); |
| 1429 | |
| 1430 | /* Notify lightningd that we've sent sigs */ |
| 1431 | wire_sync_write(REQ_FD, take(towire_dualopend_tx_sigs_sent(NULL))); |
| 1432 | } |
| 1433 | |
| 1434 | static bool |
| 1435 | fetch_psbt_changes(struct state *state, |
no test coverage detected