Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion accounting/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package accounting

import (
"errors"
"fmt"
"time"

"github.com/lightninglabs/lndclient"
Expand Down Expand Up @@ -218,7 +219,7 @@ func paymentRequestDestination(paymentRequest string,

payReq, err := decode(paymentRequest)
if err != nil {
return nil, err
return nil, fmt.Errorf("decode payment request failed: %w", err)
}

return &payReq.Destination, nil
Expand Down
8 changes: 8 additions & 0 deletions accounting/off_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func offChainReportWithPrices(cfg *OffChainConfig, getPrice usdPrice) (Report,
}
filteredInvoices := filterInvoices(cfg.StartTime, cfg.EndTime, invoices)

log.Infof("Retrieved: %v invoices, %v filtered", len(invoices),
len(filteredInvoices))

payments, err := cfg.ListPayments()
if err != nil {
return nil, err
Expand All @@ -89,13 +92,18 @@ func offChainReportWithPrices(cfg *OffChainConfig, getPrice usdPrice) (Report,
return nil, err
}

log.Infof("Retrieved: %v payments, %v filtered, %v circular",
len(payments), len(filteredPayments), len(paymentsToSelf))

// Get all our forwards, we do not need to filter them because they
// are already supplied over the relevant range for our query.
forwards, err := cfg.ListForwards()
if err != nil {
return nil, err
}

log.Infof("Retrieved: %v forwards", len(forwards))

u := entryUtils{
getFiat: getPrice,
customCategories: cfg.Categories,
Expand Down
9 changes: 5 additions & 4 deletions lndwrap/lndwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package lndwrap

import (
"context"
"fmt"
"time"

"github.com/lightninglabs/lndclient"
Expand Down Expand Up @@ -40,7 +41,7 @@ func ListInvoices(ctx context.Context, startOffset, maxInvoices uint64,
if err := paginater.QueryPaginated(
ctx, query, startOffset, maxInvoices,
); err != nil {
return nil, err
return nil, fmt.Errorf("ListInvoices failed: %w", err)
}

return invoices, nil
Expand Down Expand Up @@ -74,7 +75,7 @@ func ListPayments(ctx context.Context, startOffset, maxPayments uint64,
if err := paginater.QueryPaginated(
ctx, query, startOffset, maxPayments,
); err != nil {
return nil, err
return nil, fmt.Errorf("ListPayments failed: %w", err)
}

return payments, nil
Expand Down Expand Up @@ -111,7 +112,7 @@ func ListForwards(ctx context.Context, maxForwards uint64, startTime,
if err := paginater.QueryPaginated(
ctx, query, 0, maxForwards,
); err != nil {
return nil, err
return nil, fmt.Errorf("ListForwards failed: %w", err)
}

return forwards, nil
Expand All @@ -125,7 +126,7 @@ func ListChannels(ctx context.Context, lnd lndclient.LightningClient,
return func() ([]lndclient.ChannelInfo, error) {
resp, err := lnd.ListChannels(ctx)
if err != nil {
return nil, err
return nil, fmt.Errorf("ListChannels failed: %w", err)
}

// If we want all channels, we can just return now.
Expand Down