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

Function param_peer

lightningd/peer_control.c:3263–3281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3261}
3262
3263static struct command_result *param_peer(struct command *cmd,
3264 const char *name,
3265 const char *buffer,
3266 const jsmntok_t *tok,
3267 struct peer **peer)
3268{
3269 struct node_id peerid;
3270
3271 if (!json_to_node_id(buffer, tok, &peerid))
3272 return command_fail_badparam(cmd, name, buffer, tok,
3273 "invalid peer id");
3274 *peer = peer_by_id(cmd->ld, &peerid);
3275 if (!*peer)
3276 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
3277 "Unknown peer '%.*s'",
3278 tok->end - tok->start,
3279 buffer + tok->start);
3280 return NULL;
3281}
3282
3283static void graceful_disconnect(struct peer *peer)
3284{

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