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

Function fetch_psbt_changes

openingd/dualopend.c:1507–1538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505}
1506
1507static bool
1508fetch_psbt_changes(struct state *state,
1509 struct tx_state *tx_state,
1510 const struct wally_psbt *psbt,
1511 struct wally_psbt **updated_psbt)
1512{
1513 u8 *msg;
1514 char *err;
1515
1516 /* Go ask lightningd what other changes we've got */
1517 msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
1518 state->require_confirmed_inputs[REMOTE],
1519 tx_state->funding_serial,
1520 psbt, state->channel_type);
1521
1522 wire_sync_write(REQ_FD, take(msg));
1523
1524 msg = wire_sync_read(tmpctx, REQ_FD);
1525 while (state->developer && fromwire_dualopend_dev_memleak(msg)) {
1526 handle_dev_memleak(state, msg);
1527 msg = wire_sync_read(tmpctx, REQ_FD);
1528 }
1529
1530 if (fromwire_dualopend_fail(msg, msg, &err)) {
1531 open_abort(state, "%s", err);
1532 } else if (fromwire_dualopend_psbt_updated(state, msg, updated_psbt)) {
1533 return true;
1534 } else
1535 master_badmsg(fromwire_peektype(msg), msg);
1536
1537 return false;
1538}
1539
1540static bool send_next(struct state *state,
1541 struct tx_state *tx_state,

Callers 1

send_nextFunction · 0.85

Calls 6

open_abortFunction · 0.85
fromwire_peektypeFunction · 0.85
handle_dev_memleakFunction · 0.70
wire_sync_writeFunction · 0.50
wire_sync_readFunction · 0.50
master_badmsgFunction · 0.50

Tested by

no test coverage detected