lnd/netann/interface.go
ziggie a3fdcba511
chanstate: use channel types in interfaces
Move small interface-only consumers to chanstate.OpenChannel.

These packages only expose open-channel values through callback or
store interfaces, so they can depend on the channel-state package
without pulling in channeldb compatibility aliases.
2026-07-07 07:18:56 -03:00

27 lines
881 B
Go

package netann
import (
"context"
"github.com/btcsuite/btcd/wire/v2"
"github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/graph/db/models"
)
// DB abstracts the required database functionality needed by the
// ChanStatusManager.
type DB interface {
// FetchAllOpenChannels returns a slice of all open channels known to
// the daemon. This may include private or pending channels.
FetchAllOpenChannels() ([]*chanstate.OpenChannel, error)
}
// ChannelGraph abstracts the required channel graph queries used by the
// ChanStatusManager.
type ChannelGraph interface {
// FetchChannelEdgesByOutpoint returns the channel edge info and most
// recent channel edge policies for a given outpoint.
FetchChannelEdgesByOutpoint(context.Context, *wire.OutPoint) (
*models.ChannelEdgeInfo, *models.ChannelEdgePolicy,
*models.ChannelEdgePolicy, error)
}