decred / dcrlnd

Decred Lightning Network Daemon ⚡️
MIT License
36 stars 24 forks source link

multi: Add CalcPaymentStats to DB and RPC server #200

Closed matheusd closed 7 months ago

matheusd commented 8 months ago

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.