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:
Michael Bumann
2022-01-24 23:04:53 +01:00
parent f6367b33a0
commit 55b7943579

View File

@@ -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