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

Function fetch_psbt_changes

openingd/dualopend.c:1049–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049static struct wally_psbt *
1050fetch_psbt_changes(struct state *state,
1051 struct tx_state *tx_state,
1052 const struct wally_psbt *psbt)
1053{
1054 u8 *msg;
1055 char *err;
1056 struct wally_psbt *updated_psbt;
1057
1058 /* Go ask lightningd what other changes we've got */
1059 msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
1060 tx_state->funding_serial,
1061 psbt);
1062
1063 wire_sync_write(REQ_FD, take(msg));
1064
1065 msg = wire_sync_read(tmpctx, REQ_FD);
1066#if DEVELOPER
1067 while (fromwire_dualopend_dev_memleak(msg)) {
1068 handle_dev_memleak(state, msg);
1069 msg = wire_sync_read(tmpctx, REQ_FD);
1070 }
1071#endif
1072
1073 if (fromwire_dualopend_fail(msg, msg, &err)) {
1074 open_err_warn(state, "%s", err);
1075 } else if (fromwire_dualopend_psbt_updated(state, msg, &updated_psbt)) {
1076 return updated_psbt;
1077 } else
1078 master_badmsg(fromwire_peektype(msg), msg);
1079
1080 return NULL;
1081}
1082
1083static bool send_next(struct state *state,
1084 struct tx_state *tx_state,

Callers 1

send_nextFunction · 0.85

Calls 6

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

Tested by

no test coverage detected