Skip to content

Commit

Permalink
add settle index to invoice database
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiidb committed Jul 25, 2023
1 parent 21b7cf6 commit a12a222
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func OpenDB(config *Config) (db *gorm.DB, err error) {

type Invoice struct {
gorm.Model
AddIndex uint64
AddIndex uint64
SettleIndex uint64
}

type Payment struct {
Expand Down
3 changes: 2 additions & 1 deletion service.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (svc *Service) lookupLastPaymentTimestamp(ctx context.Context) (lastPayment

func (svc *Service) AddLastPublishedInvoice(ctx context.Context, invoice *lnrpc.Invoice) error {
return svc.db.WithContext(ctx).Create(&Invoice{
AddIndex: invoice.AddIndex,
AddIndex: invoice.AddIndex,
SettleIndex: invoice.SettleIndex,
}).Error
}

Expand Down

0 comments on commit a12a222

Please sign in to comment.