Skip to content

Commit

Permalink
router: add Cancelable flag to SendPaymentRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Sep 20, 2024
1 parent 40a3156 commit 0956c7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions router_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ type SendPaymentRequest struct {

// AMP is set to true if the payment should be an AMP payment.
AMP bool

// Cancelable controls if the payment can be interrupted manually by
// canceling the payment context, even before the payment timeout is
// reached. Note that the payment may still succeed after cancellation,
// as in-flight attempts can still settle afterward. Canceling will
// only prevent further attempts from being sent.
Cancelable bool
}

// InterceptedHtlc contains information about a htlc that was intercepted in
Expand Down Expand Up @@ -403,6 +410,7 @@ func (r *routerClient) SendPayment(ctx context.Context,
AllowSelfPayment: request.AllowSelfPayment,
Amp: request.AMP,
TimePref: request.TimePref,
Cancelable: request.Cancelable,
}
if request.MaxCltv != nil {
rpcReq.CltvLimit = *request.MaxCltv
Expand Down

0 comments on commit 0956c7a

Please sign in to comment.