From a9252fd741b99fdf25b05061c6bdcac236bc8e98 Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Thu, 18 Jan 2024 09:57:25 +0900 Subject: [PATCH] Fix: Partial Payment shows 'Could not update BTC (LNURL-Pay)' in invoice logs (#5670) --- BTCPayServer/Payments/Lightning/LightningListener.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Payments/Lightning/LightningListener.cs b/BTCPayServer/Payments/Lightning/LightningListener.cs index cbc09caae..5bdd8f76d 100644 --- a/BTCPayServer/Payments/Lightning/LightningListener.cs +++ b/BTCPayServer/Payments/Lightning/LightningListener.cs @@ -285,8 +285,12 @@ namespace BTCPayServer.Payments.Lightning } - if (oldDetails is LNURLPayPaymentMethodDetails lnurlPayPaymentMethodDetails && !string.IsNullOrEmpty(lnurlPayPaymentMethodDetails.BOLT11)) + if (oldDetails is LNURLPayPaymentMethodDetails lnurlPayPaymentMethodDetails) { + // LNUrlPay doesn't create a BOLT11 until it's actually scanned. + // So if no BOLT11 already created, which is likely the case, do nothing + if (string.IsNullOrEmpty(lnurlPayPaymentMethodDetails.BOLT11)) + continue; try { var client = _lightningLikePaymentHandler.CreateLightningClient(lnurlPayPaymentMethodDetails.LightningSupportedPaymentMethod, @@ -375,7 +379,6 @@ namespace BTCPayServer.Payments.Lightning InvoiceEventData.EventSeverity.Error); } } - await _InvoiceRepository.AddInvoiceLogs(invoice.Id, logs); _CheckInvoices.Writer.TryWrite(invoice.Id); }