lncli: switch to routerrpc.SendToRouteV2
This commit is contained in:
parent
b6170788ea
commit
0f6eacb4fa
@ -836,7 +836,7 @@ func sendToRoute(ctx *cli.Context) error {
|
|||||||
route = routes.Route
|
route = routes.Route
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &lnrpc.SendToRouteRequest{
|
req := &routerrpc.SendToRouteRequest{
|
||||||
PaymentHash: rHash,
|
PaymentHash: rHash,
|
||||||
Route: route,
|
Route: route,
|
||||||
}
|
}
|
||||||
@ -844,20 +844,13 @@ func sendToRoute(ctx *cli.Context) error {
|
|||||||
return sendToRouteRequest(ctx, req)
|
return sendToRouteRequest(ctx, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendToRouteRequest(ctx *cli.Context, req *lnrpc.SendToRouteRequest) error {
|
func sendToRouteRequest(ctx *cli.Context, req *routerrpc.SendToRouteRequest) error {
|
||||||
client, cleanUp := getClient(ctx)
|
conn := getClientConn(ctx, false)
|
||||||
defer cleanUp()
|
defer conn.Close()
|
||||||
|
|
||||||
paymentStream, err := client.SendToRoute(context.Background())
|
client := routerrpc.NewRouterClient(conn)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := paymentStream.Send(req); err != nil {
|
resp, err := client.SendToRouteV2(context.Background(), req)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := paymentStream.Recv()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user