chanstate: use channel type in gossiper

Move the gossiper channel lookup callback to chanstate.OpenChannel.

Discovery still depends on channeldb for waiting-proof persistence.
This commit only removes the channeldb compatibility alias from the
channel state lookup boundary.
This commit is contained in:
ziggie 2026-05-15 14:05:12 -03:00
parent a546c7591d
commit 7bd2447757
No known key found for this signature in database
GPG key ID: 1AFF9C4DCED6D666
2 changed files with 4 additions and 2 deletions

View file

@ -26,6 +26,7 @@ import (
"github.com/lightningnetwork/lnd/batch"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/graph"
graphdb "github.com/lightningnetwork/lnd/graph/db"
@ -384,7 +385,7 @@ type Config struct {
// FindChannel allows the gossiper to find a channel that we're party
// to without iterating over the entire set of open channels.
FindChannel func(node *btcec.PublicKey, chanID lnwire.ChannelID) (
*channeldb.OpenChannel, error)
*chanstate.OpenChannel, error)
// IsStillZombieChannel returns true if the channel described by info
// should still be considered a zombie.

View file

@ -27,6 +27,7 @@ import (
"github.com/lightningnetwork/lnd/batch"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/graph"
graphdb "github.com/lightningnetwork/lnd/graph/db"
"github.com/lightningnetwork/lnd/graph/db/models"
@ -889,7 +890,7 @@ func (ctx *testCtx) createChannelAnnouncement(blockHeight uint32, key1,
}
func mockFindChannel(node *btcec.PublicKey, chanID lnwire.ChannelID) (
*channeldb.OpenChannel, error) {
*chanstate.OpenChannel, error) {
return nil, nil
}