splice script: Switch to splice feerate
What changed, and why it matters
This commit fixes a small but meaningful bug in Core Lightning's splicing feature. When two parties jointly resize a Lightning channel via a 'splice,' the plugin was accidentally fetching the wrong fee rate (the one meant for opening ordinary channels, not for splicing). Using the wrong fee rate could make the splice transaction pay too much or too little in network fees, potentially causing the splice to fail, get stuck, or be economically unfavorable. The change simply tells the code to read the dedicated 'splice' fee rate instead of the 'opening' fee rate.
Review whether the stale 'opening' error string should be updated to 'splice'. Verify that the 'splice' feerate is always present in the feerate RPC response and that no other splice code paths still reference 'opening'. Consider adding tests covering splice fee-rate selection.
Security signals we found
Wrong fee-rate source used for protocol-specific transaction
Potential fee overpayment or underpayment in splice transaction
Possible transaction malleability or broadcast failure if fee rate is rejected by peer
Error message not updated to match new parameter name
Evidence from the diff
In plugins/spender/splice.c, feerate_get_result() parses the ‘perkw’ object from the feerate RPC response. Previously it looked up the ‘opening’ member; the patch changes it to look up the ‘splice’ member. The fallback error message still refers to ‘opening’, which appears to be an oversight. The splice command then uses splice_cmd->feerate_per_kw to set transaction fees. Using an incorrect feerate can produce a splice transaction whose fee does not match the negotiated splice policy, risking protocol failure or fee-related edge cases.
Changed components
plugins/spender/splice.cCore Lightning splice commandchannel fee-rate negotiationInspect captured patch +1 / −1
diff --git a/plugins/spender/splice.c b/plugins/spender/splice.c
index d1d0d522..62c56b27 100644
--- a/plugins/spender/splice.c
+++ b/plugins/spender/splice.c
@@ -558,7 +558,7 @@ static struct command_result *feerate_get_result(struct command *cmd,
struct splice_cmd *splice_cmd)
{
const jsmntok_t *tok = json_get_member(buf, result, "perkw");
- tok = json_get_member(buf, tok, "opening");
+ tok = json_get_member(buf, tok, "splice");
if (!json_to_u32(buf, tok, &splice_cmd->feerate_per_kw))
return command_fail_badparam(cmd, "opening", buf,
Why this scored 35/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.