diff --git a/accounting/filter.go b/accounting/filter.go index e7b9e60..f1f02b3 100644 --- a/accounting/filter.go +++ b/accounting/filter.go @@ -2,6 +2,7 @@ package accounting import ( "errors" + "fmt" "time" "github.com/lightninglabs/lndclient" @@ -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 diff --git a/accounting/off_chain.go b/accounting/off_chain.go index d4da21a..6323378 100644 --- a/accounting/off_chain.go +++ b/accounting/off_chain.go @@ -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 @@ -89,6 +92,9 @@ 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() @@ -96,6 +102,8 @@ func offChainReportWithPrices(cfg *OffChainConfig, getPrice usdPrice) (Report, return nil, err } + log.Infof("Retrieved: %v forwards", len(forwards)) + u := entryUtils{ getFiat: getPrice, customCategories: cfg.Categories, diff --git a/lndwrap/lndwrap.go b/lndwrap/lndwrap.go index a6fb1a3..9fbb023 100644 --- a/lndwrap/lndwrap.go +++ b/lndwrap/lndwrap.go @@ -5,6 +5,7 @@ package lndwrap import ( "context" + "fmt" "time" "github.com/lightninglabs/lndclient" @@ -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 @@ -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 @@ -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 @@ -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.