From f3887ebb97cd53b06730a88592c12e47c5669873 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 11 Feb 2020 12:03:44 +0100 Subject: [PATCH] lndclient: add last hop restriction --- lndclient/router_client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lndclient/router_client.go b/lndclient/router_client.go index 7b68d4f..91109ee 100644 --- a/lndclient/router_client.go +++ b/lndclient/router_client.go @@ -77,6 +77,10 @@ type SendPaymentRequest struct { // together and sorted in forward order in order to reach the // destination successfully. RouteHints [][]zpay32.HopHint + + // LastHopPubkey is the pubkey of the last hop of the route taken + // for this payment. If empty, any hop may be used. + LastHopPubkey *route.Vertex } // routerClient is a wrapper around the generated routerrpc proxy. @@ -111,6 +115,9 @@ func (r *routerClient) SendPayment(ctx context.Context, if request.OutgoingChannel != nil { rpcReq.OutgoingChanId = *request.OutgoingChannel } + if request.LastHopPubkey != nil { + rpcReq.LastHopPubkey = request.LastHopPubkey[:] + } // Only if there is no payment request set, we will parse the individual // payment parameters.