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

Function listnodes_done

lightningd/signmessage.c:125–149  ·  view source on GitHub ↗

topology tells us if it's a known node by returning details. */

Source from the content-addressed store, hash-verified

123
124/* topology tells us if it's a known node by returning details. */
125static void listnodes_done(const char *buffer,
126 const jsmntok_t *toks,
127 const jsmntok_t *idtok UNUSED,
128 struct command_and_node *can)
129{
130 struct json_stream *response;
131 const jsmntok_t *t;
132
133 t = json_get_member(buffer, toks, "result");
134 if (t)
135 t = json_get_member(buffer, t, "nodes");
136
137 if (!deprecated_apis && (!t || t->size == 0)) {
138 response = json_stream_fail(can->cmd, SIGNMESSAGE_PUBKEY_NOT_FOUND,
139 "pubkey not found in the graph");
140 json_add_node_id(response, "claimed_key", &can->id);
141 json_object_end(response);
142 was_pending(command_failed(can->cmd, response));
143 return;
144 }
145 response = json_stream_success(can->cmd);
146 json_add_node_id(response, "pubkey", &can->id);
147 json_add_bool(response, "verified", t && t->size == 1);
148 was_pending(command_success(can->cmd, response));
149}
150
151static struct command_result *json_checkmessage(struct command *cmd,
152 const char *buffer,

Callers

nothing calls this directly

Calls 9

was_pendingFunction · 0.85
json_stream_failFunction · 0.70
command_failedFunction · 0.70
json_stream_successFunction · 0.70
command_successFunction · 0.70
json_get_memberFunction · 0.50
json_add_node_idFunction · 0.50
json_object_endFunction · 0.50
json_add_boolFunction · 0.50

Tested by

no test coverage detected