| 2217 | } |
| 2218 | |
| 2219 | static struct command_result * |
| 2220 | json_splicein(struct command *cmd, const char *buf, const jsmntok_t *params) |
| 2221 | { |
| 2222 | struct out_req *req; |
| 2223 | const char *channel, *amount; |
| 2224 | struct splice_cmd *splice_cmd; |
| 2225 | char *script; |
| 2226 | |
| 2227 | if (!param(cmd, buf, params, |
| 2228 | p_req("channel", param_string, &channel), |
| 2229 | p_req("amount", param_string, &amount), |
| 2230 | NULL)) |
| 2231 | return command_param_failed(); |
| 2232 | |
| 2233 | script = tal_fmt(NULL, |
| 2234 | "wallet -> %s + fee; %s -> %s", |
| 2235 | amount, amount, channel); |
| 2236 | |
| 2237 | splice_cmd = tal(cmd, struct splice_cmd); |
| 2238 | |
| 2239 | splice_cmd->cmd = cmd; |
| 2240 | splice_cmd->script = tal_steal(splice_cmd, script); |
| 2241 | splice_cmd->psbt = create_psbt(splice_cmd, 0, 0, 0); |
| 2242 | splice_cmd->dryrun = false; |
| 2243 | splice_cmd->wetrun = false; |
| 2244 | splice_cmd->feerate_per_kw = 0; |
| 2245 | splice_cmd->force_feerate = false; |
| 2246 | splice_cmd->wallet_inputs_to_signed = 0; |
| 2247 | splice_cmd->fee_calculated = false; |
| 2248 | splice_cmd->initial_funds = AMOUNT_SAT(0); |
| 2249 | splice_cmd->emergency_sat = AMOUNT_SAT(0); |
| 2250 | splice_cmd->debug_log = NULL; |
| 2251 | splice_cmd->debug_counter = 0; |
| 2252 | splice_cmd->needed_funds = AMOUNT_SAT(0); |
| 2253 | memset(&splice_cmd->final_txid, 0, sizeof(splice_cmd->final_txid)); |
| 2254 | |
| 2255 | req = jsonrpc_request_start(cmd, "listpeerchannels", |
| 2256 | listpeerchannels_get_result, |
| 2257 | splice_error, splice_cmd); |
| 2258 | |
| 2259 | return send_outreq(req); |
| 2260 | } |
| 2261 | |
| 2262 | static struct command_result * |
| 2263 | json_spliceout(struct command *cmd, const char *buf, const jsmntok_t *params) |
nothing calls this directly
no test coverage detected