Files
lnd/lnrpc/invoicesrpc/interfaces.go
Elle Mouton 6f3d45f5d9 invoicesrpc: remove invoicerpc server's access to ChannelGraph pointer
Define a new GraphSource interface required by the invoicerpc server and
remove its access to the graphdb.ChannelGraph pointer. Add the new
invoicesrpc.GraphSource interface to the GraphSource interface
and let DBSource implement it.
2024-11-28 14:52:48 +02:00

23 lines
807 B
Go

package invoicesrpc
import (
"context"
"github.com/lightningnetwork/lnd/graph/db/models"
)
// GraphSource defines the graph interface required by the invoice rpc server.
type GraphSource interface {
// FetchChannelEdgesByID attempts to look up the two directed edges for
// the channel identified by the channel ID. If the channel can't be
// found, then graphdb.ErrEdgeNotFound is returned.
FetchChannelEdgesByID(ctx context.Context, chanID uint64) (
*models.ChannelEdgeInfo, *models.ChannelEdgePolicy,
*models.ChannelEdgePolicy, error)
// IsPublicNode is a helper method that determines whether the node with
// the given public key is seen as a public node in the graph from the
// graph's source node's point of view.
IsPublicNode(ctx context.Context, pubKey [33]byte) (bool, error)
}