mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
lncli: cancel RPC context on OS interrupts
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
@@ -21,6 +20,7 @@ var versionCommand = cli.Command{
|
||||
}
|
||||
|
||||
func version(ctx *cli.Context) error {
|
||||
ctxc := getContext()
|
||||
conn := getClientConn(ctx, false)
|
||||
defer conn.Close()
|
||||
|
||||
@@ -40,8 +40,7 @@ func version(ctx *cli.Context) error {
|
||||
|
||||
client := verrpc.NewVersionerClient(conn)
|
||||
|
||||
ctxb := context.Background()
|
||||
lndVersion, err := client.GetVersion(ctxb, &verrpc.VersionRequest{})
|
||||
lndVersion, err := client.GetVersion(ctxc, &verrpc.VersionRequest{})
|
||||
if err != nil {
|
||||
printRespJSON(versions)
|
||||
return fmt.Errorf("unable fetch version from lnd: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user