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

Function fetch_psbt_changes

openingd/dualopend.c:1434–1465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432}
1433
1434static bool
1435fetch_psbt_changes(struct state *state,
1436 struct tx_state *tx_state,
1437 const struct wally_psbt *psbt,
1438 struct wally_psbt **updated_psbt)
1439{
1440 u8 *msg;
1441 char *err;
1442
1443 /* Go ask lightningd what other changes we've got */
1444 msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
1445 state->require_confirmed_inputs[REMOTE],
1446 tx_state->funding_serial,
1447 psbt, state->channel_type);
1448
1449 wire_sync_write(REQ_FD, take(msg));
1450
1451 msg = wire_sync_read(tmpctx, REQ_FD);
1452 while (state->developer && fromwire_dualopend_dev_memleak(msg)) {
1453 handle_dev_memleak(state, msg);
1454 msg = wire_sync_read(tmpctx, REQ_FD);
1455 }
1456
1457 if (fromwire_dualopend_fail(msg, msg, &err)) {
1458 open_abort(state, "%s", err);
1459 } else if (fromwire_dualopend_psbt_updated(state, msg, updated_psbt)) {
1460 return true;
1461 } else
1462 master_badmsg(fromwire_peektype(msg), msg);
1463
1464 return false;
1465}
1466
1467static bool send_next(struct state *state,
1468 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