Skip to content

Commit

Permalink
Calculate timestamp in Go to not use PostgreSQL specific function
Browse files Browse the repository at this point in the history
  • Loading branch information
bumi committed Jan 30, 2022
1 parent d2d2451 commit 3f01c33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/service/invoicesubscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (svc *LndhubService) ProcessInvoiceUpdate(ctx context.Context, rawInvoice *
svc.Logger.Infof("Invoice update: r_hash:%s state:%v", rHashStr, rawInvoice.State.String())

// 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)
err := svc.DB.NewSelect().Model(&invoice).Where("type = ? AND r_hash = ? AND state <> ? AND expires_at > ?", "incoming", rHashStr, "settled", time.Now()).Limit(1).Scan(ctx)
if err != nil {
svc.Logger.Infof("Invoice not found. Ignoring. r_hash:%s", rHashStr)
return nil
Expand Down

0 comments on commit 3f01c33

Please sign in to comment.