| 866 | } |
| 867 | |
| 868 | static struct command_result *begin_request(struct askrene *askrene, |
| 869 | struct getroutes_info *info) |
| 870 | { |
| 871 | askrene->num_live_requests++; |
| 872 | |
| 873 | /* Wake any waiting ones when we're finished */ |
| 874 | tal_add_destructor(info->cmd, destroy_live_command); |
| 875 | |
| 876 | if (have_layer(info->layers, "auto.localchans")) { |
| 877 | struct out_req *req; |
| 878 | |
| 879 | req = jsonrpc_request_start(info->cmd, |
| 880 | "listpeerchannels", |
| 881 | listpeerchannels_done, |
| 882 | forward_error, info); |
| 883 | return send_outreq(req); |
| 884 | } else |
| 885 | info->local_layer = NULL; |
| 886 | |
| 887 | return do_getroutes(info->cmd, gossmap_localmods_new(info->cmd), info); |
| 888 | } |
| 889 | |
| 890 | static struct command_result *json_getroutes(struct command *cmd, |
| 891 | const char *buffer, |
no test coverage detected