| 3261 | } |
| 3262 | |
| 3263 | static 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 | |
| 3283 | static void graceful_disconnect(struct peer *peer) |
| 3284 | { |
no test coverage detected