invoices+rpc: add missing channel graph to the AddInvoiceConfig
The Graph which is referenced later in the AddInvoice call graph is unset when adding a hodl invoice. This resulted in a crash.
This commit is contained in:
4 files changed
+18
-9
No files matched your search
@@ -44,9 +44,13 @@ type Config struct {
|
||||
// specified.
|
||||
DefaultCLTVExpiry uint32
|
||||
|
||||
// ChanDB is a global boltdb instance which is needed to access the
|
||||
// LocalChanDB is a global boltdb instance which is needed to access the
|
||||
// channel graph.
|
||||
ChanDB *channeldb.DB
|
||||
LocalChanDB *channeldb.DB
|
||||
|
||||
// RemoteChanDB is a replicatd db instance which is the same as the
|
||||
// localdb when running without remote db.
|
||||
RemoteChanDB *channeldb.DB
|
||||
|
||||
// GenInvoiceFeatures returns a feature containing feature bits that
|
||||
// should be advertised on freshly generated invoices.
|
||||
|
||||
@@ -278,7 +278,8 @@ func (s *Server) AddHoldInvoice(ctx context.Context,
|
||||
ChainParams: s.cfg.ChainParams,
|
||||
NodeSigner: s.cfg.NodeSigner,
|
||||
DefaultCLTVExpiry: s.cfg.DefaultCLTVExpiry,
|
||||
ChanDB: s.cfg.ChanDB,
|
||||
ChanDB: s.cfg.RemoteChanDB,
|
||||
Graph: s.cfg.LocalChanDB.ChannelGraph(),
|
||||
GenInvoiceFeatures: s.cfg.GenInvoiceFeatures,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user