invoicesrpc: add HTLC modifier to invoices RPC server

This commit integrates the HTLC modifier service into the
invoices RPC server.
This commit is contained in:
ffranr
2024-04-23 14:48:42 +01:00
committed by Oliver Gugger
parent 481dfe21bc
commit 008d265cdb
4 changed files with 14 additions and 3 deletions

View File

@@ -122,7 +122,8 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config,
updateNodeAnnouncement func(features *lnwire.RawFeatureVector,
modifiers ...netann.NodeAnnModifier) error,
parseAddr func(addr string) (net.Addr, error),
rpcLogger btclog.Logger, aliasMgr *aliasmgr.Manager) error {
rpcLogger btclog.Logger, aliasMgr *aliasmgr.Manager,
invoiceHtlcModifier *invoices.HtlcModificationInterceptor) error {
// First, we'll use reflect to obtain a version of the config struct
// that allows us to programmatically inspect its fields.
@@ -241,6 +242,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config,
subCfgValue.FieldByName("InvoiceRegistry").Set(
reflect.ValueOf(invoiceRegistry),
)
subCfgValue.FieldByName("HtlcModifier").Set(
reflect.ValueOf(invoiceHtlcModifier),
)
subCfgValue.FieldByName("IsChannelActive").Set(
reflect.ValueOf(htlcSwitch.HasActiveLink),
)