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
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
@@ -21,6 +20,7 @@ var queryProbCommand = cli.Command{
|
||||
}
|
||||
|
||||
func queryProb(ctx *cli.Context) error {
|
||||
ctxc := getContext()
|
||||
args := ctx.Args()
|
||||
|
||||
if len(args) != 3 {
|
||||
@@ -56,8 +56,8 @@ func queryProb(ctx *cli.Context) error {
|
||||
ToNode: toNode[:],
|
||||
AmtMsat: int64(amtMsat),
|
||||
}
|
||||
rpcCtx := context.Background()
|
||||
response, err := client.QueryProbability(rpcCtx, req)
|
||||
|
||||
response, err := client.QueryProbability(ctxc, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user