refactor: move State server REST registration

This commit moves the registration of the State server with a REST proxy
into the `RegisterWithRestProxy` method in order to keep all the REST
registrations in one place.
This commit is contained in:
Elle Mouton
2023-08-08 11:43:25 +02:00
parent bf5aab9d52
commit b9560b067a
2 changed files with 10 additions and 8 deletions

9
lnd.go
View File

@ -901,14 +901,7 @@ func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialO
)
// Register our services with the REST proxy.
err := lnrpc.RegisterStateHandlerFromEndpoint(
ctx, mux, restProxyDest, restDialOpts,
)
if err != nil {
return nil, err
}
err = rpcServer.RegisterWithRestProxy(
err := rpcServer.RegisterWithRestProxy(
ctx, mux, restDialOpts, restProxyDest,
)
if err != nil {