From 4601359ebe103d3bb3c006edfe0b642ccc1c8d06 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 10 Sep 2024 17:33:36 +0900 Subject: [PATCH] Do not block the Lightning PendingPayoutListener if a client is failing --- .../Lightning/LightningPendingPayoutListener.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/Payments/Lightning/LightningPendingPayoutListener.cs b/BTCPayServer/Payments/Lightning/LightningPendingPayoutListener.cs index 0829f197b..55047f742 100644 --- a/BTCPayServer/Payments/Lightning/LightningPendingPayoutListener.cs +++ b/BTCPayServer/Payments/Lightning/LightningPendingPayoutListener.cs @@ -109,12 +109,16 @@ public class LightningPendingPayoutListener : BaseAsyncService break; case PayoutLightningBlob payoutLightningBlob: { - var payment = await client.GetPayment(payoutLightningBlob.Id, CancellationToken); - if (payment is null) + LightningPayment payment = null; + try { - continue; + payment = await client.GetPayment(payoutLightningBlob.Id, CancellationToken); } - + catch + { + } + if (payment is null) + continue; switch (payment.Status) { case LightningPaymentStatus.Complete: