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

Function json_channel_open_failed

plugins/funder.c:1177–1206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175}
1176
1177static struct command_result *json_channel_open_failed(struct command *cmd,
1178 const char *buf,
1179 const jsmntok_t *params)
1180{
1181 struct channel_id cid;
1182 struct pending_open *open;
1183 const char *err;
1184
1185 err = json_scan(tmpctx, buf, params,
1186 "{channel_open_failed:"
1187 "{channel_id:%}}",
1188 JSON_SCAN(json_to_channel_id, &cid));
1189 if (err)
1190 plugin_err(cmd->plugin,
1191 "`channel_open_failed` notification payload did"
1192 " not scan %s: %.*s",
1193 err, json_tok_full_len(params),
1194 json_tok_full(buf, params));
1195
1196 plugin_log(cmd->plugin, LOG_DBG,
1197 "Cleaning up inflight for channel_id %s",
1198 fmt_channel_id(tmpctx, &cid));
1199
1200 open = find_channel_pending_open(&cid);
1201 if (open)
1202 unreserve_psbt(cmd, open);
1203
1204 /* Also clean up datastore for this channel */
1205 return delete_channel_from_datastore(cmd, &cid);
1206}
1207
1208static void json_add_policy(struct json_stream *stream,
1209 struct funder_policy *policy)

Callers

nothing calls this directly

Calls 9

unreserve_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
fmt_channel_idFunction · 0.50

Tested by

no test coverage detected