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:
7 files changed
+49
-39
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user