multi: add version to models.ChannelEdgeInfo

And set it to V1 version everywhere.

Add a Version field to ChannelEdgeInfo to distinguish between v1 and
v2 channel announcements. Set it to GossipVersion1 for all existing
channels.

Both KV and SQL stores now validate that only v1 channels are
currently supported, returning an error for v2 channels. The KV store
automatically sets version to v1 when deserializing (since all
persisted channels in KV format are v1).

This versioning is essential for handling the different field
requirements and validation logic between v1 and v2 channels.
This commit is contained in:
Elle Mouton committed 2026-02-13 07:21:21 +02:00
1 parent ec46480a86
commit 4480352d59
18 files changed
+64 -1

No files matched your search

+3
View File
@@ -20,6 +20,9 @@ import (
// policy of a channel are stored within a ChannelEdgePolicy for each direction
// of the channel.
type ChannelEdgeInfo struct {
// Version is the gossip version that this channel was advertised on.
Version lnwire.GossipVersion
// ChannelID is the unique channel ID for the channel. The first 3
// bytes are the block height, the next 3 the index within the block,
// and the last 2 bytes are the output index for the channel.