| 969 | } |
| 970 | |
| 971 | static struct command_result *json_askrene_reserve(struct command *cmd, |
| 972 | const char *buffer, |
| 973 | const jsmntok_t *params) |
| 974 | { |
| 975 | struct reserve_hop *path; |
| 976 | struct json_stream *response; |
| 977 | struct askrene *askrene = get_askrene(cmd->plugin); |
| 978 | |
| 979 | if (!param(cmd, buffer, params, |
| 980 | p_req("path", param_reserve_path, &path), |
| 981 | NULL)) |
| 982 | return command_param_failed(); |
| 983 | plugin_log(cmd->plugin, LOG_TRACE, "%s called: %.*s", __func__, |
| 984 | json_tok_full_len(params), json_tok_full(buffer, params)); |
| 985 | |
| 986 | for (size_t i = 0; i < tal_count(path); i++) |
| 987 | reserve_add(askrene->reserved, &path[i], cmd->id); |
| 988 | |
| 989 | response = jsonrpc_stream_success(cmd); |
| 990 | return command_finished(cmd, response); |
| 991 | } |
| 992 | |
| 993 | static struct command_result *json_askrene_unreserve(struct command *cmd, |
| 994 | const char *buffer, |
nothing calls this directly
no test coverage detected