mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
routerrpc: remove reflection-based initialization
This commit is contained in:
parent
ffa7bed7f0
commit
767c4f2298
1 changed files with 8 additions and 14 deletions
|
@ -219,21 +219,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
|
|||
reflect.ValueOf(genInvoiceFeatures),
|
||||
)
|
||||
|
||||
// RouterRPC isn't conditionally compiled and doesn't need to be
|
||||
// populated using reflection.
|
||||
case *routerrpc.Config:
|
||||
subCfgValue := extractReflectValue(subCfg)
|
||||
|
||||
subCfgValue.FieldByName("NetworkDir").Set(
|
||||
reflect.ValueOf(networkDir),
|
||||
)
|
||||
subCfgValue.FieldByName("MacService").Set(
|
||||
reflect.ValueOf(macService),
|
||||
)
|
||||
subCfgValue.FieldByName("Router").Set(
|
||||
reflect.ValueOf(chanRouter),
|
||||
)
|
||||
subCfgValue.FieldByName("RouterBackend").Set(
|
||||
reflect.ValueOf(routerBackend),
|
||||
)
|
||||
|
||||
case *watchtowerrpc.Config:
|
||||
subCfgValue := extractReflectValue(subCfg)
|
||||
|
@ -266,6 +254,12 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
|
|||
}
|
||||
}
|
||||
|
||||
// Populate routerrpc dependencies.
|
||||
s.RouterRPC.NetworkDir = networkDir
|
||||
s.RouterRPC.MacService = macService
|
||||
s.RouterRPC.Router = chanRouter
|
||||
s.RouterRPC.RouterBackend = routerBackend
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue