This will return a SCB for all the channels currently loaded * in the in-memory channel */
| 1992 | /* This will return a SCB for all the channels currently loaded |
| 1993 | * in the in-memory channel */ |
| 1994 | static struct command_result *json_staticbackup(struct command *cmd, |
| 1995 | const char *buffer, |
| 1996 | const jsmntok_t *obj UNNEEDED, |
| 1997 | const jsmntok_t *params) |
| 1998 | { |
| 1999 | struct json_stream *response; |
| 2000 | struct peer *peer; |
| 2001 | struct channel *channel; |
| 2002 | |
| 2003 | if (!param(cmd, buffer, params, NULL)) |
| 2004 | return command_param_failed(); |
| 2005 | |
| 2006 | response = json_stream_success(cmd); |
| 2007 | |
| 2008 | json_array_start(response, "scb"); |
| 2009 | |
| 2010 | list_for_each(&cmd->ld->peers, peer, list) |
| 2011 | list_for_each(&peer->channels, channel, list){ |
| 2012 | if (!channel->scb) |
| 2013 | continue; |
| 2014 | json_add_scb(cmd, NULL, response, channel); |
| 2015 | } |
| 2016 | json_array_end(response); |
| 2017 | |
| 2018 | return command_success(cmd, response); |
| 2019 | } |
| 2020 | |
| 2021 | static const struct json_command staticbackup_command = { |
| 2022 | "staticbackup", |
nothing calls this directly
no test coverage detected