Skip to content

Commit f3887eb

Browse files
committed
lndclient: add last hop restriction
1 parent 736daaf commit f3887eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lndclient/router_client.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ type SendPaymentRequest struct {
7777
// together and sorted in forward order in order to reach the
7878
// destination successfully.
7979
RouteHints [][]zpay32.HopHint
80+
81+
// LastHopPubkey is the pubkey of the last hop of the route taken
82+
// for this payment. If empty, any hop may be used.
83+
LastHopPubkey *route.Vertex
8084
}
8185

8286
// routerClient is a wrapper around the generated routerrpc proxy.
@@ -111,6 +115,9 @@ func (r *routerClient) SendPayment(ctx context.Context,
111115
if request.OutgoingChannel != nil {
112116
rpcReq.OutgoingChanId = *request.OutgoingChannel
113117
}
118+
if request.LastHopPubkey != nil {
119+
rpcReq.LastHopPubkey = request.LastHopPubkey[:]
120+
}
114121

115122
// Only if there is no payment request set, we will parse the individual
116123
// payment parameters.

0 commit comments

Comments
 (0)