diff --git a/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentHandler.cs b/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentHandler.cs index 7ce73aa7d..a655d07de 100644 --- a/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentHandler.cs +++ b/BTCPayServer/Payments/LNURLPay/LNURLPayPaymentHandler.cs @@ -67,7 +67,7 @@ namespace BTCPayServer.Payments.Lightning { throw new PaymentMethodUnavailableException("LNURL requires a lightning node to be configured for the store."); } - using var cts = new CancellationTokenSource(5000); + using var cts = new CancellationTokenSource(LightningLikePaymentHandler.LightningTimeout); try { var client = lnSupported.CreateLightningClient(network, Options.Value, _lightningClientFactoryService); diff --git a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs index a33b8c9f1..544b76313 100644 --- a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs @@ -21,7 +21,7 @@ namespace BTCPayServer.Payments.Lightning { public class LightningLikePaymentHandler : PaymentMethodHandlerBase { - public static int LIGHTNING_TIMEOUT = 5000; + public static readonly int LightningTimeout = 5000; readonly NBXplorerDashboard _Dashboard; private readonly LightningClientFactoryService _lightningClientFactory; private readonly BTCPayNetworkProvider _networkProvider; @@ -93,7 +93,7 @@ namespace BTCPayServer.Payments.Lightning description = description.Replace("{StoreName}", store.StoreName ?? "", StringComparison.OrdinalIgnoreCase) .Replace("{ItemDescription}", invoice.Metadata.ItemDesc ?? "", StringComparison.OrdinalIgnoreCase) .Replace("{OrderId}", invoice.Metadata.OrderId ?? "", StringComparison.OrdinalIgnoreCase); - using (var cts = new CancellationTokenSource(LIGHTNING_TIMEOUT)) + using (var cts = new CancellationTokenSource(LightningTimeout)) { try { @@ -129,7 +129,7 @@ namespace BTCPayServer.Payments.Lightning try { - using var cts = new CancellationTokenSource(LIGHTNING_TIMEOUT); + using var cts = new CancellationTokenSource(LightningTimeout); var client = CreateLightningClient(supportedPaymentMethod, network); LightningNodeInformation info; try