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

Function param_peer

lightningd/peer_control.c:3193–3211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3191}
3192
3193static struct command_result *param_peer(struct command *cmd,
3194 const char *name,
3195 const char *buffer,
3196 const jsmntok_t *tok,
3197 struct peer **peer)
3198{
3199 struct node_id peerid;
3200
3201 if (!json_to_node_id(buffer, tok, &peerid))
3202 return command_fail_badparam(cmd, name, buffer, tok,
3203 "invalid peer id");
3204 *peer = peer_by_id(cmd->ld, &peerid);
3205 if (!*peer)
3206 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
3207 "Unknown peer '%.*s'",
3208 tok->end - tok->start,
3209 buffer + tok->start);
3210 return NULL;
3211}
3212
3213static void graceful_disconnect(struct peer *peer)
3214{

Callers 1

param_dev_channelFunction · 0.85

Calls 4

peer_by_idFunction · 0.85
command_failFunction · 0.70
json_to_node_idFunction · 0.50
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected