chanstate: use channel type in backup notifier
What changed, and why it matters
This is a small internal code cleanup in LND. It changes one function parameter type from channeldb.OpenChannel to chanstate.OpenChannel inside the channel backup notifier. There is no visible security fix, behavior change, or bug correction in the diff. It appears to be part of a larger refactoring to move channel-state logic into a new chanstate package.
No security action required. Treat as routine refactoring. Reviewers may want to confirm that chanstate.OpenChannel is type-compatible with the fields used (IdentityPub, etc.) and that downstream consumers compile correctly.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies channel_notifier.go so that sendChanOpenUpdate accepts chanstate.OpenChannel instead of channeldb.OpenChannel. The surrounding logic (address lookup, close type handling, channel backup payload construction) remains unchanged. The change aligns the backup notifier with chanstate-owned backup interfaces. No vulnerability, bounds check, cryptographic operation, or access-control change is present.
Changed components
channel_notifier.gochanbackup.ChannelNotifier adapterInspect captured patch +2 / −1
diff --git a/channel_notifier.go b/channel_notifier.go
index 360fb6c..c700e7b 100644
--- a/channel_notifier.go
+++ b/channel_notifier.go
@@ -8,6 +8,7 @@ import (
"github.com/lightningnetwork/lnd/chanbackup"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channelnotifier"
+ "github.com/lightningnetwork/lnd/chanstate"
)
// channelNotifier is an implementation of the chanbackup.ChannelNotifier
@@ -46,7 +47,7 @@ func (c *channelNotifier) SubscribeChans(ctx context.Context,
// sendChanOpenUpdate is a closure that sends a ChannelEvent to the
// chanUpdates channel to inform subscribers about new pending or
// confirmed channels.
- sendChanOpenUpdate := func(newOrPendingChan *channeldb.OpenChannel) {
+ sendChanOpenUpdate := func(newOrPendingChan *chanstate.OpenChannel) {
_, nodeAddrs, err := c.addrs.AddrsForNode(
ctx, newOrPendingChan.IdentityPub,
)
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.