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

Send `update_add_htlc` messages after HTLC removal messages

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Send `update_add_htlc` messages after HTLC removal messages

While nodes are generally supposed to validate commitment
transactions after the `commitent_signed` and not while HTLCs are
being added/removed, we don't. This can make a commitment update
where we use HTLC balance claimed with a fulfill to send new HTLCs,
which is perfectly valid, being rejected. While we shouldn't
currently generate any such commitments, we might want to in the
future, and on the off-chance that we do, or where such a
commitment would result in a dust threshold overrun, its always
safter to add new HTLCs to a commitment only after we've removed
any HTLCs we're going to remove, which we do here.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes the order in which Lightning network messages are sent to peers. Previously, new HTLCs (payment forwards) were announced before old HTLCs were removed with fulfill/fail messages. Now, removal messages are sent first. The commit message explains that this prevents a peer from rejecting a commitment update in cases where a newly claimed balance is used to fund a new HTLC in the same update. The change is defensive and does not fix an active exploit, but closes a protocol-handling edge case that could cause channel updates to be rejected.

Recommended action

Treat as a low-risk hardening patch. Reviewers should confirm that update_fee placement remains correct and that no other code paths enqueue update_add_htlcs before removals. No urgent security response is indicated by the commit itself.

Security signals we found

01

Message ordering change in Lightning protocol message handling

02

Defensive fix for potential commitment transaction validation rejection

03

Commit message describes a scenario where a commitment update could be rejected by a peer

04

No active exploit or vulnerability class (e.g., theft, DoS) is directly demonstrated in the diff

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/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.