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
@@ -2507,7 +2507,9 @@ func (s *SQLStore) HasChannelEdge(v lnwire.GossipVersion,
|
||||
// the database, then ErrEdgeNotFound is returned.
|
||||
//
|
||||
// NOTE: part of the Store interface.
|
||||
func (s *SQLStore) ChannelID(chanPoint *wire.OutPoint) (uint64, error) {
|
||||
func (s *SQLStore) ChannelID(v lnwire.GossipVersion,
|
||||
chanPoint *wire.OutPoint) (uint64, error) {
|
||||
|
||||
var (
|
||||
ctx = context.TODO()
|
||||
channelID uint64
|
||||
@@ -2516,7 +2518,7 @@ func (s *SQLStore) ChannelID(chanPoint *wire.OutPoint) (uint64, error) {
|
||||
chanID, err := db.GetSCIDByOutpoint(
|
||||
ctx, sqlc.GetSCIDByOutpointParams{
|
||||
Outpoint: chanPoint.String(),
|
||||
Version: int16(lnwire.GossipVersion1),
|
||||
Version: int16(v),
|
||||
},
|
||||
)
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
|
||||
Reference in new issue
Block a user