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

+7 -2
View File
@@ -4257,14 +4257,19 @@ func (c *KVStore) markEdgeLiveUnsafe(tx kvdb.RwTx, chanID uint64) error {
// IsZombieEdge returns whether the edge is considered zombie. If it is a
// zombie, then the two node public keys corresponding to this edge are also
// returned.
func (c *KVStore) IsZombieEdge(chanID uint64) (bool, [33]byte, [33]byte,
error) {
func (c *KVStore) IsZombieEdge(v lnwire.GossipVersion,
chanID uint64) (bool, [33]byte, [33]byte, error) {
var (
isZombie bool
pubKey1, pubKey2 [33]byte
)
if v != lnwire.GossipVersion1 {
return false, [33]byte{}, [33]byte{},
ErrVersionNotSupportedForKVDB
}
err := kvdb.View(c.db, func(tx kvdb.RTx) error {
edges := tx.ReadBucket(edgeBucket)
if edges == nil {