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

Function json_disconnect

plugins/funder.c:1126–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1124}
1125
1126static struct command_result *json_disconnect(struct command *cmd,
1127 const char *buf,
1128 const jsmntok_t *params)
1129{
1130 struct node_id id;
1131 const char *err;
1132
1133 err = json_scan(tmpctx, buf, params,
1134 "{disconnect:{id:%}}",
1135 JSON_SCAN(json_to_node_id, &id));
1136 if (err)
1137 plugin_err(cmd->plugin,
1138 "`disconnect` notification payload did not"
1139 " scan %s: %.*s",
1140 err, json_tok_full_len(params),
1141 json_tok_full(buf, params));
1142
1143 plugin_log(cmd->plugin, LOG_DBG,
1144 "Cleaning up inflights for peer id %s",
1145 fmt_node_id(tmpctx, &id));
1146
1147 cleanup_peer_pending_opens(cmd, &id);
1148
1149 return notification_handled(cmd);
1150}
1151
1152static struct command_result *
1153delete_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