graph/db: version highest chan id

Add a gossip version parameter to HighestChanID in the Store interface
and both KV/SQL implementations. Update callers in the discovery
ChanSeries and server bootstrap code.
This commit is contained in:
Elle Mouton committed 2026-02-20 09:28:13 +02:00
1 parent 95d6af12d4
commit 769d6260f5
7 files changed
+49 -39

No files matched your search

+7 -1
View File
@@ -2056,7 +2056,13 @@ func getChanID(tx kvdb.RTx, chanPoint *wire.OutPoint) (uint64, error) {
// HighestChanID returns the "highest" known channel ID in the channel graph.
// This represents the "newest" channel from the PoV of the chain. This method
// can be used by peers to quickly determine if they're graphs are in sync.
func (c *KVStore) HighestChanID(_ context.Context) (uint64, error) {
func (c *KVStore) HighestChanID(_ context.Context,
v lnwire.GossipVersion) (uint64, error) {
if v != lnwire.GossipVersion1 {
return 0, ErrVersionNotSupportedForKVDB
}
var cid uint64
err := kvdb.View(c.db, func(tx kvdb.RTx) error {