File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,6 +194,16 @@ func isStatusReq(uri string) bool {
194194 )
195195}
196196
197+ // isShutdownReq returns true if the given request is a Litd shutdown request.
198+ func isShutdownReq (uri string ) bool {
199+ return strings .HasPrefix (
200+ uri , fmt .Sprintf (
201+ "/%s/%s" , litrpc .LitService_ServiceDesc .ServiceName ,
202+ "StopDaemon" ,
203+ ),
204+ )
205+ }
206+
197207// Stop shuts down the lnd connection.
198208func (p * rpcProxy ) Stop () error {
199209 p .grpcServer .Stop ()
@@ -397,8 +407,9 @@ func (p *rpcProxy) checkSubSystemStarted(requestURI string) error {
397407 system = LitdSubServer
398408
399409 // If the request is for the status server, then we allow the
400- // request even if Lit has not properly started.
401- if isStatusReq (requestURI ) {
410+ // request even if Lit has not properly started. We also allow
411+ // the request through if it is a Litd shutdown.
412+ if isStatusReq (requestURI ) || isShutdownReq (requestURI ) {
402413 return nil
403414 }
404415
Original file line number Diff line number Diff line change @@ -576,8 +576,8 @@ func (g *LightningTerminal) start() error {
576576
577577 case err := <- g .errQueue .ChanOut ():
578578 if err != nil {
579- log .Errorf ("Received critical error from subsystem, " +
580- "shutting down: %v" , err )
579+ return fmt .Errorf ("received critical error from " +
580+ "subsystem, shutting down: %v" , err )
581581 }
582582
583583 case <- lndQuit :
You can’t perform that action at this time.
0 commit comments