Skip to content

Commit

Permalink
fix: breez limit
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Feb 1, 2024
1 parent 90b7228 commit 88b121d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions breez.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ func (bs *BreezService) LookupInvoice(ctx context.Context, senderPubkey string,
func (bs *BreezService) ListTransactions(ctx context.Context, senderPubkey string, from, until, limit, offset uint64, unpaid bool, invoiceType string) (transactions []Nip47Transaction, err error) {

request := breez_sdk.ListPaymentsRequest{}
if limit == 0 {
// make sure a sensible limit is passed
limit = 100
}
if limit > 0 {
limit32 := uint32(limit)
request.Limit = &limit32
Expand All @@ -210,8 +214,7 @@ func (bs *BreezService) ListTransactions(ctx context.Context, senderPubkey strin
}

transactions = []Nip47Transaction{}
paymentList := payments[0:100]
for _, payment := range paymentList {
for _, payment := range payments {
if payment.PaymentType != breez_sdk.PaymentTypeReceived && payment.PaymentType != breez_sdk.PaymentTypeSent {
// skip other types of payments for now
continue
Expand Down

0 comments on commit 88b121d

Please sign in to comment.