| 172 | } |
| 173 | |
| 174 | static struct command_result *json_getroute(struct command *cmd, |
| 175 | const char *buffer, |
| 176 | const jsmntok_t *params) |
| 177 | { |
| 178 | struct getroute_info *info = tal(cmd, struct getroute_info); |
| 179 | struct out_req *req; |
| 180 | u64 *fuzz_ignored; |
| 181 | |
| 182 | if (!param(cmd, buffer, params, |
| 183 | p_req("id", param_node_id, &info->destination), |
| 184 | p_req("amount_msat", param_msat, &info->msat), |
| 185 | p_req("riskfactor", param_millionths, &info->riskfactor_millionths), |
| 186 | p_opt_def("cltv", param_number, &info->cltv, 9), |
| 187 | p_opt_def("fromid", param_node_id, &info->source, local_id), |
| 188 | p_opt("fuzzpercent", param_millionths, &fuzz_ignored), |
| 189 | p_opt("exclude", param_route_exclusion_array, &info->excluded), |
| 190 | p_opt_def("maxhops", param_number, &info->max_hops, ROUTING_MAX_HOPS), |
| 191 | NULL)) |
| 192 | return command_param_failed(); |
| 193 | |
| 194 | /* Add local info */ |
| 195 | req = jsonrpc_request_start(cmd, "listpeerchannels", |
| 196 | listpeerchannels_getroute_done, |
| 197 | plugin_broken_cb, info); |
| 198 | return send_outreq(req); |
| 199 | } |
| 200 | |
| 201 | /* To avoid multiple fetches, we represent directions as a bitmap |
| 202 | * so we can do two at once. */ |
nothing calls this directly
no test coverage detected