multi: Add CalcPaymentStats to DB and RPC server #200
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a CalcPaymentStats call to the db, RPC server and dcrlncli. This allows querying the database for a report on the total number of payments tracked.
An upstream lnd PR (number 5635) will include a migration that goes through every payment. While the PR has been tested upstream to not be a problem even for nodes with large numbers of payments, there is no actual way to know whether a node would be a problem (due to no existing way to query the total number of payments in the DB).
This PR prepares for an upstream port of an lnd version that includes the aforementioned PR by exposing the total counts of payments, which would be migrated.
This will allow node operators to evaluate whether the payments should be cleared from the database before performing the migration.