Skip to content

Commit 97134ce

Browse files
committed
graph/db: add VersionedGraph MarkEdgeZombie and MarkEdgeLive wrappers
Add MarkEdgeZombie and MarkEdgeLive convenience methods to VersionedGraph that supply the gossip version from the embedded field, matching the pattern used by other VersionedGraph wrappers.
1 parent 644be3e commit 97134ce

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

graph/db/graph.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,23 @@ func (c *VersionedGraph) DeleteChannelEdges(ctx context.Context,
10511051
)
10521052
}
10531053

1054+
// MarkEdgeZombie marks a channel as a zombie for this version.
1055+
func (c *VersionedGraph) MarkEdgeZombie(ctx context.Context, chanID uint64,
1056+
pubKey1, pubKey2 [33]byte) error {
1057+
1058+
return c.ChannelGraph.MarkEdgeZombie(
1059+
ctx, c.v, chanID, pubKey1, pubKey2,
1060+
)
1061+
}
1062+
1063+
// MarkEdgeLive clears an edge from our zombie index for this version, deeming
1064+
// it as live.
1065+
func (c *VersionedGraph) MarkEdgeLive(ctx context.Context,
1066+
chanID uint64) error {
1067+
1068+
return c.ChannelGraph.MarkEdgeLive(ctx, c.v, chanID)
1069+
}
1070+
10541071
// HasChannelEdge returns true if the database knows of a channel edge with the
10551072
// passed channel ID and this graph's gossip version, and false otherwise. If it
10561073
// is not found, then the zombie index is checked and its result is returned as

0 commit comments

Comments
 (0)