routerrpc: remove reflection-based initialization
This commit is contained in:
parent
ffa7bed7f0
commit
767c4f2298
@ -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…
Reference in New Issue
Block a user