2018-12-20 13:42:28 +03:00
|
|
|
// +build invoicesrpc
|
|
|
|
|
|
|
|
package invoicesrpc
|
|
|
|
|
|
|
|
import (
|
2019-01-03 21:15:14 +03:00
|
|
|
"github.com/btcsuite/btcd/chaincfg"
|
2019-01-15 14:11:22 +03:00
|
|
|
"github.com/lightningnetwork/lnd/channeldb"
|
2018-12-20 13:42:28 +03:00
|
|
|
"github.com/lightningnetwork/lnd/invoices"
|
2019-01-15 14:11:22 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnwire"
|
2019-01-03 21:15:14 +03:00
|
|
|
"github.com/lightningnetwork/lnd/macaroons"
|
2019-01-15 14:11:22 +03:00
|
|
|
"github.com/lightningnetwork/lnd/netann"
|
2018-12-20 13:42:28 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// Config is the primary configuration struct for the invoices RPC server. It
|
|
|
|
// contains all the items required for the rpc server to carry out its
|
|
|
|
// duties. The fields with struct tags are meant to be parsed as normal
|
|
|
|
// configuration options, while if able to be populated, the latter fields MUST
|
|
|
|
// also be specified.
|
|
|
|
type Config struct {
|
2019-01-03 21:15:14 +03:00
|
|
|
// NetworkDir is the main network directory wherein the invoices rpc
|
|
|
|
// server will find the macaroon named DefaultInvoicesMacFilename.
|
|
|
|
NetworkDir string
|
|
|
|
|
|
|
|
// MacService is the main macaroon service that we'll use to handle
|
|
|
|
// authentication for the invoices rpc server.
|
|
|
|
MacService *macaroons.Service
|
|
|
|
|
|
|
|
// InvoiceRegistry is a central registry of all the outstanding invoices
|
|
|
|
// created by the daemon.
|
2018-12-20 13:42:28 +03:00
|
|
|
InvoiceRegistry *invoices.InvoiceRegistry
|
2019-01-03 21:15:14 +03:00
|
|
|
|
2019-01-15 14:11:22 +03:00
|
|
|
// IsChannelActive is used to generate valid hop hints.
|
|
|
|
IsChannelActive func(chanID lnwire.ChannelID) bool
|
|
|
|
|
2019-01-03 21:15:14 +03:00
|
|
|
// ChainParams are required to properly decode invoice payment requests
|
|
|
|
// that are marshalled over rpc.
|
|
|
|
ChainParams *chaincfg.Params
|
2019-01-15 14:11:22 +03:00
|
|
|
|
|
|
|
// NodeSigner is an implementation of the MessageSigner implementation
|
|
|
|
// that's backed by the identity private key of the running lnd node.
|
|
|
|
NodeSigner *netann.NodeSigner
|
|
|
|
|
|
|
|
// DefaultCLTVExpiry is the default invoice expiry if no values is
|
|
|
|
// specified.
|
|
|
|
DefaultCLTVExpiry uint32
|
|
|
|
|
|
|
|
// ChanDB is a global boltdb instance which is needed to access the
|
|
|
|
// channel graph.
|
|
|
|
ChanDB *channeldb.DB
|
2019-12-11 00:09:52 +03:00
|
|
|
|
|
|
|
// GenInvoiceFeatures returns a feature containing feature bits that
|
|
|
|
// should be advertised on freshly generated invoices.
|
|
|
|
GenInvoiceFeatures func() *lnwire.FeatureVector
|
2018-12-20 13:42:28 +03:00
|
|
|
}
|