MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_staticbackup

Function json_staticbackup

lightningd/peer_control.c:1994–2019  ·  view source on GitHub ↗

This will return a SCB for all the channels currently loaded * in the in-memory channel */

Source from the content-addressed store, hash-verified

1992/* This will return a SCB for all the channels currently loaded
1993 * in the in-memory channel */
1994static 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
2021static const struct json_command staticbackup_command = {
2022 "staticbackup",

Callers

nothing calls this directly

Calls 7

json_add_scbFunction · 0.85
command_param_failedFunction · 0.70
json_stream_successFunction · 0.70
command_successFunction · 0.70
paramFunction · 0.50
json_array_startFunction · 0.50
json_array_endFunction · 0.50

Tested by

no test coverage detected