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

Function json_channel_open_failed

plugins/funder.c:1214–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212}
1213
1214static struct command_result *json_channel_open_failed(struct command *cmd,
1215 const char *buf,
1216 const jsmntok_t *params)
1217{
1218 struct channel_id cid;
1219 struct pending_open *open;
1220 const char *err;
1221
1222 err = json_scan(tmpctx, buf, params,
1223 "{channel_open_failed:"
1224 "{channel_id:%}}",
1225 JSON_SCAN(json_to_channel_id, &cid));
1226 if (err)
1227 plugin_err(cmd->plugin,
1228 "`channel_open_failed` notification payload did"
1229 " not scan %s: %.*s",
1230 err, json_tok_full_len(params),
1231 json_tok_full(buf, params));
1232
1233 plugin_log(cmd->plugin, LOG_DBG,
1234 "Cleaning up inflight for channel_id %s",
1235 fmt_channel_id(tmpctx, &cid));
1236
1237 open = find_channel_pending_open(&cid);
1238 if (open)
1239 unreserve_psbt(cmd, open);
1240
1241 /* Keep the channel's saved utxos: a failed RBF attempt also ends up
1242 * here, and the next RBF still builds on them. They're removed when
1243 * the channel leaves AWAITING_LOCKIN (json_channel_state_changed). */
1244 return notification_handled(cmd);
1245}
1246
1247static void json_add_policy(struct json_stream *stream,
1248 struct funder_policy *policy)

Callers

nothing calls this directly

Calls 9

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