What changed, and why it matters
This commit adds a new user-facing command called 'splicein' to Core Lightning. It is a convenience wrapper around the existing experimental 'dev-splice' feature, letting users splice additional funds into an existing Lightning channel with a simpler command. The change is purely additive and does not appear to fix any security issue.
No security action required. Review as normal feature code, including input validation and error handling in the underlying splice script system.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces json_splicein() in plugins/spender/splice.c, which accepts ‘channel’ and ‘amount’ parameters and constructs a splice script string (‘wallet ->
Changed components
plugins/spender/splice.ctests/test_splice.pyInspect captured patch +47 / −1
diff --git a/plugins/spender/splice.c b/plugins/spender/splice.c
index 1bbe2545..403eb366 100644
--- a/plugins/spender/splice.c
+++ b/plugins/spender/splice.c
@@ -2203,10 +2203,57 @@ json_splice(struct command *cmd, const char *buf, const jsmntok_t *params)
return send_outreq(req);
}
+static struct command_result *
+json_splicein(struct command *cmd, const char *buf, const jsmntok_t *params)
+{
+ struct out_req *req;
+ const char *channel, *amount;
+ struct splice_cmd *splice_cmd;
+ char *script;
+
+ if (!param(cmd, buf, params,
+ p_req("channel", param_string, &channel),
+ p_req("amount", param_string, &amount),
+ NULL))
+ return command_param_failed();
+
+ script = tal_fmt(NULL,
+ "wallet -> %s + fee; %s -> %s",
+ amount, amount, channel);
+
+ splice_cmd = tal(cmd, struct splice_cmd);
+
+ splice_cmd->cmd = cmd;
+ splice_cmd->script = tal_steal(splice_cmd, script);
+ splice_cmd->psbt = create_psbt(splice_cmd, 0, 0, 0);
+ splice_cmd->dryrun = false;
+ splice_cmd->wetrun = false;
+ splice_cmd->feerate_per_kw = 0;
+ splice_cmd->force_feerate = false;
+ splice_cmd->wallet_inputs_to_signed = 0;
+ splice_cmd->fee_calculated = false;
+ splice_cmd->initial_funds = AMOUNT_SAT(0);
+ splice_cmd->emergency_sat = AMOUNT_SAT(0);
+ splice_cmd->debug_log = NULL;
+ splice_cmd->debug_counter = 0;
+ splice_cmd->needed_funds = AMOUNT_SAT(0);
+ memset(&splice_cmd->final_txid, 0, sizeof(splice_cmd->final_txid));
+
+ req = jsonrpc_request_start(cmd, "listpeerchannels",
+ listpeerchannels_get_result,
+ splice_error, splice_cmd);
+
+ return send_outreq(req);
+}
+
const struct plugin_command splice_commands[] = {
{
"dev-splice",
json_splice
},
+ {
+ "splicein",
+ json_splicein
+ },
};
const size_t num_splice_commands = ARRAY_SIZE(splice_commands);
diff --git a/tests/test_splice.py b/tests/test_splice.py
index 18e1393f..babff47f 100644
--- a/tests/test_splice.py
+++ b/tests/test_splice.py
@@ -308,7 +308,6 @@ def test_script_two_chan_splice_inout(node_factory, bitcoind):
l2.rpc.pay(inv['bolt11'])
-@pytest.mark.xfail(strict=True)
@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.