Previously, the revenue report used its own pagination function which
returned the wrong offset, resulting in endless querying for forward
events if we used more than one page of events. This change updates
the revenue report to use the existing lndwrap package which has the
correct values.
We will require generic pagination in a variety of places. Extract the
existing logic in our revenue package to a generic function that can
be used for any paginated endpoint. Although the existing forwarding
events API uses uint32, we use uint64 because it is used in lnd's
invoice and payments endpoints.
The only place where we need start and end time for revenue reports
is the forwarding history query, which is passed in anyway. Remove
these params and rather just pass in a forwarding history query which
will limit to start/end time.
Earlier commits in this repo were made with 4 spaces in a tab instead
of 8. This commit updates relevant files to wrap at 80 chars with this
line spacing.
This change logs short channel ids that we cannot find in our set
of open, pending and closed channels. This provides a better UX than
blindly failing the whole revenue report because we cannot find a single
channel.
This commit adds a getEvents function which accumulates
the results of a paginated forwarder log query to obtain
a full set of events. It uses a map of known channel id
mappings to convert short channel ids to outpoints.
Add a revenue report which provides information
about pairwise volume and revenue for channels
over a set of forwarding events. Fees are split
between incoming and outgoing channels because
forwards are enabled by pairs of channels.