| 2983 | } |
| 2984 | |
| 2985 | static 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 | |
| 3005 | static void graceful_disconnect(struct peer *peer) |
| 3006 | { |
no test coverage detected