mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-02-23 13:54:25 +01:00
Do not handle invoices not found in the subscription handler as errors
the app will get notfied of any invoice and not just the invoices we have created. Thus we ignore the updates for invoices we do not know about. This is not an error
This commit is contained in:
@@ -21,7 +21,8 @@ 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 > NOW()", "incoming", rHashStr, "settled").Limit(1).Scan(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
svc.Logger.Infof("Invoice not found. Ignoring. r_hash:%s", rHashStr)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update the DB entry of the invoice
|
||||
|
||||
Reference in New Issue
Block a user