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

Function listnodes_done

lightningd/signmessage.c:121–146  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected