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

Function json_channel_open_failed

plugins/funder.c:760–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760static struct command_result *json_channel_open_failed(struct command *cmd,
761 const char *buf,
762 const jsmntok_t *params)
763{
764 struct channel_id cid;
765 struct pending_open *open;
766 const char *err;
767
768 err = json_scan(tmpctx, buf, params,
769 "{channel_open_failed:"
770 "{channel_id:%}}",
771 JSON_SCAN(json_to_channel_id, &cid));
772 if (err)
773 plugin_err(cmd->plugin,
774 "`channel_open_failed` notification payload did"
775 " not scan %s: %.*s",
776 err, json_tok_full_len(params),
777 json_tok_full(buf, params));
778
779 plugin_log(cmd->plugin, LOG_DBG,
780 "Cleaning up inflight for channel_id %s",
781 type_to_string(tmpctx, struct channel_id, &cid));
782
783 open = find_channel_pending_open(&cid);
784 if (open)
785 unreserve_psbt(open);
786
787 return notification_handled(cmd);
788}
789
790static void json_add_policy(struct json_stream *stream,
791 struct funder_policy *policy)

Callers

nothing calls this directly

Calls 9

unreserve_psbtFunction · 0.85
notification_handledFunction · 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