splice: Add details to log message
What changed, and why it matters
This commit only adds extra details to existing error log messages during a Lightning channel splicing operation. It does not change program logic, fix a bug, or alter security behavior. It is a diagnostic/logging improvement.
No security action needed; treat as routine logging enhancement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change expands two log/error messages in channeld/channeld.c’s check_balances() to include formatted values (funding_amount, opener_relative, whether the local node is the opener, owed amount, and expected change). The control flow and abort/warn calls remain identical; only the human-readable strings are richer.
Changed components
channeld/channeld.csplicing log messages in check_balances()Inspect captured patch +11 / −3
diff --git a/channeld/channeld.c b/channeld/channeld.c
index d50e81b2..69b322f5 100644
--- a/channeld/channeld.c
+++ b/channeld/channeld.c
@@ -3283,7 +3283,10 @@ static struct amount_sat check_balances(struct peer *peer,
if (!amount_msat_add_sat_s64(&funding_amount, funding_amount,
peer->splicing->opener_relative))
splice_abort(peer, "Splice initiator did not provide enough"
- " funding");
+ " funding, funding_amount: %s, opener_relative:"
+ " %"PRIu64,
+ fmt_amount_msat(tmpctx, funding_amount),
+ peer->splicing->opener_relative);
if (!amount_msat_add_sat_s64(&out[TX_INITIATOR], out[TX_INITIATOR],
peer->splicing->opener_relative))
peer_failed_warn(peer->pps, &peer->channel_id,
@@ -3309,11 +3312,16 @@ static struct amount_sat check_balances(struct peer *peer,
" amount. Initiator contributing %s but they"
" committed to %s. Pending offered HTLC"
" balance of %s is not available for this"
- " operation.",
+ " operation. We are%s the opener. We began the"
+ " operation being owed/owing %s and expect"
+ " that amount to change %"PRIu64"000",
fmt_amount_msat(tmpctx, in[TX_INITIATOR]),
fmt_amount_msat(tmpctx, out[TX_INITIATOR]),
fmt_amount_msat(tmpctx,
- pending_htlcs[TX_INITIATOR]));
+ pending_htlcs[TX_INITIATOR]),
+ opener ? "" : " not",
+ fmt_amount_msat(tmpctx, peer->channel->view->owed[opener ? LOCAL : REMOTE]),
+ peer->splicing->opener_relative);
}
if (!amount_msat_sub(&initiator_fee, in[TX_INITIATOR], out[TX_INITIATOR]))
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.