mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-08 20:03:10 +01:00
signal: handle shutdown properly
This addresses issues related to the mobile lnd builds, where calling `stopDaemon` and subsequently calling LndMobile's `Start` results in crash.
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@@ -467,7 +466,7 @@ func openChannelPsbt(rpcCtx context.Context, ctx *cli.Context,
|
||||
// the server.
|
||||
go func() {
|
||||
select {
|
||||
case <-signal.ShutdownChannel():
|
||||
case <-rpcCtx.Done():
|
||||
fmt.Printf("\nInterrupt signal received.\n")
|
||||
close(quit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user