mirror of https://github.com/BTCPrivate/lnd.git
networktest: use StopDaemon RPC to stop lnd instead of SIGINT
This commit is contained in:
parent
91e14497bb
commit
24db310aef
|
@ -11,7 +11,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -308,13 +307,11 @@ func (l *lightningNode) Stop() error {
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
// Don't watch for error because sometimes the RPC connection gets
|
||||||
if err := l.cmd.Process.Signal(os.Kill); err != nil {
|
// closed before a response is returned.
|
||||||
return err
|
req := lnrpc.StopRequest{}
|
||||||
}
|
ctx := context.Background()
|
||||||
} else if err := l.cmd.Process.Signal(os.Interrupt); err != nil {
|
l.LightningClient.StopDaemon(ctx, &req)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
close(l.quit)
|
close(l.quit)
|
||||||
l.wg.Wait()
|
l.wg.Wait()
|
||||||
|
|
Loading…
Reference in New Issue