From 32448c4b0c43c74e654d0a6b695700f4a3bf97c8 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 2 Dec 2022 18:55:53 +0100 Subject: [PATCH] on-the-fly deletion --- lnbits/core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 824bbc88..8abf23d8 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -178,7 +178,7 @@ class Payment(BaseModel): logger.debug(f"Status: {status}") - if self.is_in and self.is_expired: + if self.is_in and status.pending and self.is_expired: expiration_date = datetime.datetime.fromtimestamp(self.expiry) logger.debug( f"Deleting expired incoming payment {self.checking_id}: expired {expiration_date}"