multi: set invoice feature bits using feature manager

This commit is contained in:
Conner Fromknecht
2019-12-10 13:09:52 -08:00
parent a168f37b9c
commit 1367187454
5 changed files with 33 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
"github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc"
"github.com/lightningnetwork/lnd/lnrpc/wtclientrpc"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/macaroons"
"github.com/lightningnetwork/lnd/netann"
"github.com/lightningnetwork/lnd/routing"
@@ -92,7 +93,8 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
sweeper *sweep.UtxoSweeper,
tower *watchtower.Standalone,
towerClient wtclient.Client,
tcpResolver lncfg.TCPResolver) error {
tcpResolver lncfg.TCPResolver,
genInvoiceFeatures func() *lnwire.FeatureVector) error {
// First, we'll use reflect to obtain a version of the config struct
// that allows us to programmatically inspect its fields.
@@ -210,6 +212,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
subCfgValue.FieldByName("ChanDB").Set(
reflect.ValueOf(chanDB),
)
subCfgValue.FieldByName("GenInvoiceFeatures").Set(
reflect.ValueOf(genInvoiceFeatures),
)
case *routerrpc.Config:
subCfgValue := extractReflectValue(subCfg)