graph/db: add version parameter to IsZombieEdge

Make IsZombieEdge version-aware and add corresponding method to
VersionedGraph. Convert TestEdgeInsertionDeletion to versioned test
using the createEdge helper for both v1 and v2 channel testing.
This commit is contained in:
Elle Mouton committed 2026-02-13 07:21:23 +02:00
1 parent d88fa01162
commit 03050a589d
5 files changed
+103 -65

No files matched your search

+8 -1
View File
@@ -735,7 +735,7 @@ func (c *ChannelGraph) ChannelView() ([]EdgePoint, error) {
func (c *ChannelGraph) IsZombieEdge(chanID uint64) (bool, [33]byte, [33]byte,
error) {
return c.db.IsZombieEdge(chanID)
return c.db.IsZombieEdge(lnwire.GossipVersion1, chanID)
}
// NumZombies returns the current number of zombie channels in the graph.
@@ -806,6 +806,13 @@ func (c *VersionedGraph) FetchChannelEdgesByOutpoint(op *wire.OutPoint) (
return c.db.FetchChannelEdgesByOutpoint(c.v, op)
}
// IsZombieEdge returns whether the edge is considered zombie for this version.
func (c *VersionedGraph) IsZombieEdge(chanID uint64) (bool, [33]byte,
[33]byte, error) {
return c.db.IsZombieEdge(c.v, chanID)
}
// AddrsForNode returns all known addresses for the target node public key.
func (c *VersionedGraph) AddrsForNode(ctx context.Context,
nodePub *btcec.PublicKey) (bool, []net.Addr, error) {