diff --git a/docs/release-notes/release-notes-0.20.1.md b/docs/release-notes/release-notes-0.20.1.md index 4cc4556fb0a..34bdad40622 100644 --- a/docs/release-notes/release-notes-0.20.1.md +++ b/docs/release-notes/release-notes-0.20.1.md @@ -32,6 +32,11 @@ addresses](https://github.com/lightningnetwork/lnd/pull/10341) were added to the node announcement and `getinfo` output. +* Fix a bug where [missing edges for own channels could not be added to the + graph DB](https://github.com/lightningnetwork/lnd/pull/10410) + due to validation checks in the graph Builder that were resurfaced after the + graph refactor work. + # New Features ## Functional Enhancements diff --git a/routing/localchans/manager.go b/routing/localchans/manager.go index b1d281187d1..2c95bf5d098 100644 --- a/routing/localchans/manager.go +++ b/routing/localchans/manager.go @@ -50,6 +50,10 @@ type Manager struct { error) // AddEdge is used to add edge/channel to the topology of the router. + // + // NOTE: this is only used to recreate our own missing edges during + // policy updates. This is a workaround for the following issue: + // https://github.com/lightningnetwork/lnd/issues/7261 AddEdge func(ctx context.Context, edge *models.ChannelEdgeInfo) error // policyUpdateLock ensures that the database and the link do not fall diff --git a/server.go b/server.go index 1c2db3d9107..a666457a4b0 100644 --- a/server.go +++ b/server.go @@ -1148,7 +1148,11 @@ func newServer(ctx context.Context, cfg *Config, listenAddrs []net.Addr, AddEdge: func(ctx context.Context, edge *models.ChannelEdgeInfo) error { - return s.graphBuilder.AddEdge(ctx, edge) + // AddEdge is only called for our own local channels, so + // we skip the extra validation done by the graph + // builder here and instead write the edge directly to + // the graph database. + return s.graphDB.AddChannelEdge(ctx, edge) }, }