mirror of https://github.com/BTCPrivate/lnd.git
cmd/lncli: convert queryRoute to queryRoutes
This commit is contained in:
parent
04a6c2f7f6
commit
dabaf9da70
|
@ -1323,8 +1323,8 @@ func getNodeInfo(ctx *cli.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var queryRouteCommand = cli.Command{
|
var queryRoutesCommand = cli.Command{
|
||||||
Name: "queryroute",
|
Name: "queryroutes",
|
||||||
Usage: "Query a route to a destination.",
|
Usage: "Query a route to a destination.",
|
||||||
Description: "Queries the channel router for a potential path to the destination that has sufficient flow for the amount including fees",
|
Description: "Queries the channel router for a potential path to the destination that has sufficient flow for the amount including fees",
|
||||||
ArgsUsage: "dest amt",
|
ArgsUsage: "dest amt",
|
||||||
|
@ -1339,10 +1339,10 @@ var queryRouteCommand = cli.Command{
|
||||||
Usage: "the amount to send expressed in satoshis",
|
Usage: "the amount to send expressed in satoshis",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: queryRoute,
|
Action: queryRoutes,
|
||||||
}
|
}
|
||||||
|
|
||||||
func queryRoute(ctx *cli.Context) error {
|
func queryRoutes(ctx *cli.Context) error {
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
client, cleanUp := getClient(ctx)
|
client, cleanUp := getClient(ctx)
|
||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
|
@ -1377,12 +1377,12 @@ func queryRoute(ctx *cli.Context) error {
|
||||||
return fmt.Errorf("amt argument missing")
|
return fmt.Errorf("amt argument missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &lnrpc.RouteRequest{
|
req := &lnrpc.QueryRoutesRequest{
|
||||||
PubKey: dest,
|
PubKey: dest,
|
||||||
Amt: amt,
|
Amt: amt,
|
||||||
}
|
}
|
||||||
|
|
||||||
route, err := client.QueryRoute(ctxb, req)
|
route, err := client.QueryRoutes(ctxb, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ func main() {
|
||||||
describeGraphCommand,
|
describeGraphCommand,
|
||||||
getChanInfoCommand,
|
getChanInfoCommand,
|
||||||
getNodeInfoCommand,
|
getNodeInfoCommand,
|
||||||
queryRouteCommand,
|
queryRoutesCommand,
|
||||||
getNetworkInfoCommand,
|
getNetworkInfoCommand,
|
||||||
debugLevelCommand,
|
debugLevelCommand,
|
||||||
decodePayReqComamnd,
|
decodePayReqComamnd,
|
||||||
|
|
Loading…
Reference in New Issue