| 920 | } |
| 921 | |
| 922 | static struct command_result *begin_request(struct askrene *askrene, |
| 923 | struct getroutes_info *info) |
| 924 | { |
| 925 | askrene->num_live_requests++; |
| 926 | |
| 927 | /* Wake any waiting ones when we're finished */ |
| 928 | tal_add_destructor(info->cmd, destroy_live_command); |
| 929 | |
| 930 | if (have_layer(info->layers, "auto.localchans")) { |
| 931 | struct out_req *req; |
| 932 | |
| 933 | req = jsonrpc_request_start(info->cmd, |
| 934 | "listpeerchannels", |
| 935 | listpeerchannels_done, |
| 936 | forward_error, info); |
| 937 | return send_outreq(req); |
| 938 | } else |
| 939 | info->local_layer = NULL; |
| 940 | |
| 941 | return do_getroutes(info->cmd, gossmap_localmods_new(info->cmd), info); |
| 942 | } |
| 943 | |
| 944 | static struct command_result *json_getroutes(struct command *cmd, |
| 945 | const char *buffer, |
no test coverage detected