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

Function json_disconnect

plugins/funder.c:1089–1113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087}
1088
1089static struct command_result *json_disconnect(struct command *cmd,
1090 const char *buf,
1091 const jsmntok_t *params)
1092{
1093 struct node_id id;
1094 const char *err;
1095
1096 err = json_scan(tmpctx, buf, params,
1097 "{disconnect:{id:%}}",
1098 JSON_SCAN(json_to_node_id, &id));
1099 if (err)
1100 plugin_err(cmd->plugin,
1101 "`disconnect` notification payload did not"
1102 " scan %s: %.*s",
1103 err, json_tok_full_len(params),
1104 json_tok_full(buf, params));
1105
1106 plugin_log(cmd->plugin, LOG_DBG,
1107 "Cleaning up inflights for peer id %s",
1108 fmt_node_id(tmpctx, &id));
1109
1110 cleanup_peer_pending_opens(cmd, &id);
1111
1112 return notification_handled(cmd);
1113}
1114
1115static struct command_result *
1116delete_channel_from_datastore(struct command *cmd,

Callers

nothing calls this directly

Calls 8

fmt_node_idFunction · 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

Tested by

no test coverage detected