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

Function json_openchannel2_changed_call

plugins/funder.c:236–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static struct command_result *
237json_openchannel2_changed_call(struct command *cmd,
238 const char *buf,
239 const jsmntok_t *params)
240{
241 struct channel_id cid;
242 struct wally_psbt *psbt;
243 const char *err;
244
245 err = json_scan(tmpctx, buf, params,
246 "{openchannel2_changed:"
247 "{channel_id:%,psbt:%}}",
248 JSON_SCAN(json_to_channel_id, &cid),
249 JSON_SCAN_TAL(cmd, json_to_psbt, &psbt));
250
251 if (err)
252 plugin_err(cmd->plugin,
253 "`openchannel2_changed` payload did not"
254 " scan %s: %.*s",
255 err, json_tok_full_len(params),
256 json_tok_full(buf, params));
257
258 plugin_log(cmd->plugin, LOG_DBG,
259 "openchannel_changed PSBT is %s",
260 type_to_string(tmpctx, struct wally_psbt, psbt));
261
262 /* FIXME: do we have any additions or updates to make based
263 * on their changes? */
264 /* For now, we assume we're the same as before and continue
265 * on as planned */
266 return command_hook_cont_psbt(cmd, psbt);
267}
268
269/* Tiny struct to pass info to callback for fundpsbt */
270struct open_info {

Callers

nothing calls this directly

Calls 7

command_hook_cont_psbtFunction · 0.85
plugin_errFunction · 0.70
plugin_logFunction · 0.70
json_scanFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50
type_to_stringClass · 0.50

Tested by

no test coverage detected