mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-18 10:06:51 +01:00
netann+lnd: add netann.ChannelGraph to the GraphSource interface
And let DBSource implement it.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/graph/db/models"
|
||||
"github.com/lightningnetwork/lnd/graph/session"
|
||||
@@ -105,6 +106,17 @@ func (s *DBSource) IsPublicNode(_ context.Context,
|
||||
return s.db.IsPublicNode(pubKey)
|
||||
}
|
||||
|
||||
// FetchChannelEdgesByOutpoint returns the channel edge info and most recent
|
||||
// channel edge policies for a given outpoint.
|
||||
//
|
||||
// NOTE: this is part of the netann.ChannelGraph interface.
|
||||
func (s *DBSource) FetchChannelEdgesByOutpoint(_ context.Context,
|
||||
point *wire.OutPoint) (*models.ChannelEdgeInfo,
|
||||
*models.ChannelEdgePolicy, *models.ChannelEdgePolicy, error) {
|
||||
|
||||
return s.db.FetchChannelEdgesByOutpoint(point)
|
||||
}
|
||||
|
||||
// kvdbRTx is an implementation of graphdb.RTx backed by a KVDB database read
|
||||
// transaction.
|
||||
type kvdbRTx struct {
|
||||
|
||||
Reference in New Issue
Block a user