What changed, and why it matters
This commit is a straightforward internal code cleanup. It changes three interface definitions to reference a new package (chanstate.OpenChannel) instead of an older one (channeldb.OpenChannel). There is no functional change to how the software behaves, no bug fix, and no security-related change.
No security action needed. Treat as normal refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch performs a refactoring move: interface-only consumers of open-channel values in discovery/ban.go, netann/interface.go, and routing/blindedpath/blinded_path.go now depend on chanstate.OpenChannel rather than channeldb.OpenChannel. The commit message explicitly states the goal is to let these packages depend on the channel-state package without pulling in channeldb compatibility aliases. The diff consists solely of import and type-reference substitutions; no logic, control flow, or data handling changes.
Changed components
discovery/ban.gonetann/interface.gorouting/blindedpath/blinded_path.goInspect captured patch +7 / −7
diff --git a/discovery/ban.go b/discovery/ban.go
index 0425948..80f5f8f 100644
--- a/discovery/ban.go
+++ b/discovery/ban.go
@@ -10,7 +10,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/lightninglabs/neutrino/cache"
"github.com/lightninglabs/neutrino/cache/lru"
- "github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/lnwire"
)
@@ -67,7 +67,7 @@ type GraphCloser interface {
type NodeInfoInquirer interface {
// FetchOpenChannels returns the set of channels that we have with the
// peer identified by the passed-in public key.
- FetchOpenChannels(*btcec.PublicKey) ([]*channeldb.OpenChannel, error)
+ FetchOpenChannels(*btcec.PublicKey) ([]*chanstate.OpenChannel, error)
}
// ScidCloserMan helps the gossiper handle closed channels that are in the
diff --git a/netann/interface.go b/netann/interface.go
index 291eb01..366805b 100644
--- a/netann/interface.go
+++ b/netann/interface.go
@@ -4,7 +4,7 @@ import (
"context"
"github.com/btcsuite/btcd/wire/v2"
- "github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/graph/db/models"
)
@@ -13,7 +13,7 @@ import (
type DB interface {
// FetchAllOpenChannels returns a slice of all open channels known to
// the daemon. This may include private or pending channels.
- FetchAllOpenChannels() ([]*channeldb.OpenChannel, error)
+ FetchAllOpenChannels() ([]*chanstate.OpenChannel, error)
}
// ChannelGraph abstracts the required channel graph queries used by the
diff --git a/routing/blindedpath/blinded_path.go b/routing/blindedpath/blinded_path.go
index 77676e3..044a87e 100644
--- a/routing/blindedpath/blinded_path.go
+++ b/routing/blindedpath/blinded_path.go
@@ -10,7 +10,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil/v2"
sphinx "github.com/lightningnetwork/lightning-onion"
- "github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/graph/db/models"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/record"
@@ -46,7 +46,7 @@ type BuildBlindedPathCfg struct {
*models.ChannelEdgePolicy, *models.ChannelEdgePolicy, error)
// FetchOurOpenChannels fetches this node's set of open channels.
- FetchOurOpenChannels func() ([]*channeldb.OpenChannel, error)
+ FetchOurOpenChannels func() ([]*chanstate.OpenChannel, error)
// BestHeight can be used to fetch the best block height that this node
// is aware of.
@@ -529,7 +529,7 @@ func buildDummyRouteData(node route.Vertex, relayInfo *record.PaymentRelayInfo,
// we use the provided default policy values, and we get the average capacity of
// this node's channels to compute a MaxHTLC value.
func computeDummyHopPolicy(defaultPolicy *BlindedHopPolicy,
- fetchOurChannels func() ([]*channeldb.OpenChannel, error),
+ fetchOurChannels func() ([]*chanstate.OpenChannel, error),
policies map[uint64]*BlindedHopPolicy) (*BlindedHopPolicy, error) {
numPolicies := len(policies)
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.