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

Function fetch_psbt_changes

openingd/dualopend.c:1536–1567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534}
1535
1536static bool
1537fetch_psbt_changes(struct state *state,
1538 struct tx_state *tx_state,
1539 const struct wally_psbt *psbt,
1540 struct wally_psbt **updated_psbt)
1541{
1542 u8 *msg;
1543 char *err;
1544
1545 /* Go ask lightningd what other changes we've got */
1546 msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
1547 state->require_confirmed_inputs[REMOTE],
1548 tx_state->funding_serial,
1549 psbt, state->channel_type);
1550
1551 wire_sync_write(REQ_FD, take(msg));
1552
1553 msg = wire_sync_read(tmpctx, REQ_FD);
1554 while (state->developer && fromwire_dualopend_dev_memleak(msg)) {
1555 handle_dev_memleak(state, msg);
1556 msg = wire_sync_read(tmpctx, REQ_FD);
1557 }
1558
1559 if (fromwire_dualopend_fail(msg, msg, &err)) {
1560 open_abort(state, "%s", err);
1561 } else if (fromwire_dualopend_psbt_updated(state, msg, updated_psbt)) {
1562 return true;
1563 } else
1564 master_badmsg(fromwire_peektype(msg), msg);
1565
1566 return false;
1567}
1568
1569static bool send_next(struct state *state,
1570 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