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

Function handle_splice_cmd

plugins/spender/splice.c:2019–2040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2017}
2018
2019static struct command_result *handle_splice_cmd(struct command *cmd,
2020 struct splice_cmd *splice_cmd)
2021{
2022 struct out_req *req;
2023
2024 if (splice_cmd->dryrun)
2025 return splice_dryrun(cmd, splice_cmd);
2026
2027 req = jsonrpc_request_start(cmd, "stfu_channels",
2028 stfu_channels_get_result,
2029 splice_error, splice_cmd);
2030
2031 json_array_start(req->js, "channel_ids");
2032 /* We begin by stfu'ing and getting available balance on all MAX reqs */
2033 for (size_t i = 0; i < tal_count(splice_cmd->actions); i++)
2034 if (splice_cmd->actions[i]->channel_id)
2035 json_add_channel_id(req->js, NULL,
2036 splice_cmd->actions[i]->channel_id);
2037 json_array_end(req->js);
2038
2039 return send_outreq(req);
2040}
2041
2042static struct command_result *
2043validate_splice_cmd(struct splice_cmd *splice_cmd)

Callers 1

Calls 5

splice_dryrunFunction · 0.85
json_array_startFunction · 0.85
json_add_channel_idFunction · 0.85
json_array_endFunction · 0.85
send_outreqFunction · 0.50

Tested by

no test coverage detected