graph/db: version ChannelID lookup

Add a gossip version parameter to the ChannelID method (outpoint to
short channel ID lookup) in the Store interface and both KV/SQL
implementations. Update the VersionedGraph wrapper and tests.
This commit is contained in:
Elle Mouton committed 2026-02-20 09:19:22 +02:00
1 parent 2f6cc185a7
commit 28fe3585ac
5 files changed
+26 -9

No files matched your search

+7 -1
View File
@@ -1998,7 +1998,13 @@ func (c *KVStore) DeleteChannelEdges(v lnwire.GossipVersion,
// ChannelID attempt to lookup the 8-byte compact channel ID which maps to the
// passed channel point (outpoint). If the passed channel doesn't exist within
// the database, then ErrEdgeNotFound is returned.
func (c *KVStore) ChannelID(chanPoint *wire.OutPoint) (uint64, error) {
func (c *KVStore) ChannelID(v lnwire.GossipVersion,
chanPoint *wire.OutPoint) (uint64, error) {
if v != lnwire.GossipVersion1 {
return 0, ErrVersionNotSupportedForKVDB
}
var chanID uint64
if err := kvdb.View(c.db, func(tx kvdb.RTx) error {
var err error