Skip to content

Commit 1b00381

Browse files
committed
terminal: add missing stop of pool daemon
We forgot to shut down the pool server cleanly when terminating LiT. While we touch this section of the code we might also shorten it a bit by using the one line assignment/if construct.
1 parent 6e1803b commit 1b00381

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

terminal.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,22 +423,27 @@ func (g *LightningTerminal) shutdown() error {
423423
var returnErr error
424424

425425
if g.faradayStarted {
426-
err := g.faradayServer.Stop()
427-
if err != nil {
426+
if err := g.faradayServer.Stop(); err != nil {
428427
log.Errorf("Error stopping faraday: %v", err)
429428
returnErr = err
430429
}
431430
}
432431

433432
if g.loopStarted {
434433
g.loopServer.Stop()
435-
err := <-g.loopServer.ErrChan
436-
if err != nil {
434+
if err := <-g.loopServer.ErrChan; err != nil {
437435
log.Errorf("Error stopping loop: %v", err)
438436
returnErr = err
439437
}
440438
}
441439

440+
if g.poolStarted {
441+
if err := g.poolServer.Stop(); err != nil {
442+
log.Errorf("Error stopping pool: %v", err)
443+
returnErr = err
444+
}
445+
}
446+
442447
if g.lndClient != nil {
443448
g.lndClient.Close()
444449
}

0 commit comments

Comments
 (0)