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