MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_send_tx_sigs

Function handle_send_tx_sigs

openingd/dualopend.c:1392–1432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1390}
1391
1392static 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
1434static bool
1435fetch_psbt_changes(struct state *state,

Callers 3

accepter_startFunction · 0.85
rbf_wrap_upFunction · 0.85
handle_master_inFunction · 0.85

Calls 11

psbt_txidFunction · 0.85
fmt_bitcoin_txidFunction · 0.85
tal_wally_startFunction · 0.85
tal_wally_endFunction · 0.85
tal_freeFunction · 0.85
fmt_wally_psbtFunction · 0.85
psbt_to_tx_sigs_msgFunction · 0.85
peer_writeFunction · 0.85
master_badmsgFunction · 0.50
status_failedFunction · 0.50
wire_sync_writeFunction · 0.50

Tested by

no test coverage detected