htlcswitch: let link notify on remote commit sig
What changed, and why it matters
This small change makes a Lightning payment channel component notify subscribers whenever the remote side signs a new commitment. It is a state-visibility improvement, not a direct fix for a known exploit. The commit message and diff do not describe a security vulnerability, but missing or delayed channel-state notifications could theoretically contribute to stale state in dependent subsystems.
Review callers of NotifyChannelUpdate to confirm they handle the newly emitted event correctly and that no subscriber assumes the notification is only sent on local-initiated changes. No urgent deployment action is indicated by the diff alone.
Security signals we found
Adds missing event notification after remote commitment signature processing
Touches commitment-state lifecycle in payment channel code
No input validation, cryptographic, or access-control changes present
Evidence from the diff
In htlcswitch/link.go, after a remote CommitSig is processed successfully, the link now calls l.cfg.NotifyChannelUpdate(l.channel.ChannelState()). This ensures that local subscribers are told the channel state has advanced once the local commitment is irrevocably committed. The patch adds a notification only; it does not alter cryptographic validation or commitment logic.
Changed components
htlcswitch/link.gochannel commitment state notification pathInspect captured patch +7 / −0
diff --git a/htlcswitch/link.go b/htlcswitch/link.go
index f67d4b4..1db005b 100644
--- a/htlcswitch/link.go
+++ b/htlcswitch/link.go
@@ -1817,6 +1817,13 @@ func (l *channelLink) handleUpstreamMsg(ctx context.Context,
case *lnwire.CommitSig:
err = l.processRemoteCommitSig(ctx, msg)
+ // At this point our local commitment state has been irrevocably
+ // committed to and our balances are updated. We notify our
+ // subscribers that the channel state has been updated.
+ if err == nil {
+ l.cfg.NotifyChannelUpdate(l.channel.ChannelState())
+ }
+
case *lnwire.RevokeAndAck:
err = l.processRemoteRevokeAndAck(ctx, msg)
Why this scored 30/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.