| 3191 | } |
| 3192 | |
| 3193 | static 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 | |
| 3213 | static void graceful_disconnect(struct peer *peer) |
| 3214 | { |
no test coverage detected