AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 17 Bitcoin

Add `NextCommitmentStats::get_balances_including_fee`

Public commit record

What the developer wrote

Authored by Leo Nash

63/100 · Adequate
Add `NextCommitmentStats::get_balances_including_fee`

`NextCommitmentStats` provides the commitment transaction fee as a
separate value to assist with applying a multiplier on it in
`can_accept_incoming_htlc`.

Nonetheless in most cases, we want the balances to include the
commitment transaction fee, so here we add a helper that gives us these
balances.

Also make the style of `tx_builder::subtract_addl_outputs` consistent
with `get_balances_including_fee`.
✓ Specific, descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a small helper function to include transaction fees when calculating Lightning channel balances. It also makes an existing internal function's code style match the new helper. There is no obvious security bug being fixed; it appears to be a routine code cleanup and convenience addition.

Recommended action

No immediate action required. Review as part of normal code maintenance. If this commit is part of a larger PR, consider whether the new helper is used correctly in subsequent commits.

Security signals we found

01

No security-relevant keywords in commit title or message

02

No bug-fix language or CVE references

03

Change is additive (new helper) and stylistic (refactor)

04

Uses checked_sub to avoid underflow, which is defensive but not a fix for a known bug

Risk score

Why this scored 17/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.