From a04f8dfd4f3afb4a2c64b5d2e2319bbb4e874a2b Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Thu, 21 Nov 2024 20:06:40 +0200 Subject: [PATCH] lnd: pass ctx to rest proxy --- lnd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnd.go b/lnd.go index f51181195..77456fa15 100644 --- a/lnd.go +++ b/lnd.go @@ -379,7 +379,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, implCfg *ImplementationCfg, // wildcard to prevent certificate issues when accessing the proxy // externally. stopProxy, err := startRestProxy( - cfg, rpcServer, restDialOpts, restListen, + ctx, cfg, rpcServer, restDialOpts, restListen, ) if err != nil { return mkErr("error starting REST proxy: %v", err) @@ -921,7 +921,8 @@ func startGrpcListen(cfg *Config, grpcServer *grpc.Server, // startRestProxy starts the given REST proxy on the listeners found in the // config. -func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialOption, +func startRestProxy(ctx context.Context, cfg *Config, rpcServer *rpcServer, + restDialOpts []grpc.DialOption, restListen func(net.Addr) (net.Listener, error)) (func(), error) { // We use the first RPC listener as the destination for our REST proxy. @@ -948,7 +949,6 @@ func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialO } // Start a REST proxy for our gRPC server. - ctx := context.Background() ctx, cancel := context.WithCancel(ctx) shutdownFuncs = append(shutdownFuncs, cancel)