chanstate: use channel type in backup notifier

Move the root backup notifier adapter to chanstate.OpenChannel.

The adapter still depends on channeldb for address sourcing and close
type handling, but the new-channel payload it forwards into chanbackup
now matches the chanstate-owned backup interfaces.
This commit is contained in:
ziggie 2026-05-15 13:39:02 -03:00
parent dac8a8fe53
commit 897f2ce54c
No known key found for this signature in database
GPG key ID: 1AFF9C4DCED6D666

View file

@ -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,
)