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

Function param_peer

lightningd/peer_control.c:2985–3003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2983}
2984
2985static struct command_result *param_peer(struct command *cmd,
2986 const char *name,
2987 const char *buffer,
2988 const jsmntok_t *tok,
2989 struct peer **peer)
2990{
2991 struct node_id peerid;
2992
2993 if (!json_to_node_id(buffer, tok, &peerid))
2994 return command_fail_badparam(cmd, name, buffer, tok,
2995 "invalid peer id");
2996 *peer = peer_by_id(cmd->ld, &peerid);
2997 if (!*peer)
2998 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
2999 "Unknown peer '%.*s'",
3000 tok->end - tok->start,
3001 buffer + tok->start);
3002 return NULL;
3003}
3004
3005static void graceful_disconnect(struct peer *peer)
3006{

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