Skip to content

Commit 29c2c23

Browse files
committed
router: add Cancelable flag to SendPaymentRequest
1 parent 8487459 commit 29c2c23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

router_client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ type SendPaymentRequest struct {
284284

285285
// AMP is set to true if the payment should be an AMP payment.
286286
AMP bool
287+
288+
// If set, the payment loop can be interrupted by manually canceling
289+
// the payment context, even before the payment timeout is reached.
290+
// Note that the payment may still succeed after cancellation, as
291+
// in-flight attempts can still settle afterward. Canceling will only
292+
// prevent further attempts from being sent.
293+
Cancelable bool
287294
}
288295

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

0 commit comments

Comments
 (0)