From 0956c7a516bc58d1098319cb266acb208681c5d6 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Fri, 20 Sep 2024 13:38:58 +0200 Subject: [PATCH] router: add Cancelable flag to SendPaymentRequest --- router_client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/router_client.go b/router_client.go index 5cc841d..e9531a7 100644 --- a/router_client.go +++ b/router_client.go @@ -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 @@ -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