From cb46f10ce202c50cb59c1017c021ab98ea167366 Mon Sep 17 00:00:00 2001 From: kiwiidb Date: Fri, 2 Jun 2023 10:36:42 +0200 Subject: [PATCH] don't require incoming invoices to be non-expired --- lib/service/invoicesubscription.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/service/invoicesubscription.go b/lib/service/invoicesubscription.go index 725a09e..909e7b8 100644 --- a/lib/service/invoicesubscription.go +++ b/lib/service/invoicesubscription.go @@ -100,11 +100,10 @@ func (svc *LndhubService) ProcessInvoiceUpdate(ctx context.Context, rawInvoice * } } // Search for an incoming invoice with the r_hash that is NOT settled in our DB - err := svc.DB.NewSelect().Model(&invoice).Where("type = ? AND r_hash = ? AND state <> ? AND expires_at > ?", + err := svc.DB.NewSelect().Model(&invoice).Where("type = ? AND r_hash = ? AND state <> ? ", common.InvoiceTypeIncoming, rHashStr, - common.InvoiceStateSettled, - time.Now()).Limit(1).Scan(ctx) + common.InvoiceStateSettled).Limit(1).Scan(ctx) if err != nil { svc.Logger.Infof("Invoice not found. Ignoring. r_hash:%s", rHashStr) return nil