lncli: cancel RPC context on OS interrupts
This commit is contained in:
1 parent
fa4155c126
commit
54c93b1b86
19 files changed
+211
-181
No files matched your search
@@ -3,8 +3,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
@@ -37,6 +35,7 @@ var towerInfoCommand = cli.Command{
|
||||
}
|
||||
|
||||
func towerInfo(ctx *cli.Context) error {
|
||||
ctxc := getContext()
|
||||
if ctx.NArg() != 0 || ctx.NumFlags() > 0 {
|
||||
return cli.ShowCommandHelp(ctx, "info")
|
||||
}
|
||||
@@ -45,7 +44,7 @@ func towerInfo(ctx *cli.Context) error {
|
||||
defer cleanup()
|
||||
|
||||
req := &watchtowerrpc.GetInfoRequest{}
|
||||
resp, err := client.GetInfo(context.Background(), req)
|
||||
resp, err := client.GetInfo(ctxc, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user