mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-23 23:55:02 +01:00
Merge pull request #379 from getAlby/fix/also-update-expired-invoices
don't require incoming invoices to be non-expired
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user