invoices: optionally garbage collect invoices on the fly

This commit extends invoice garbage collection to also remove invoices
which are canceled when LND is already up and running. When the option
GcCanceledInvoicesOnTheFly is false (default) then invoices are kept and
the behavior is unchanged.
This commit is contained in:
Andras Banki-Horvath
2020-08-04 18:28:15 +02:00
parent a0d7877d9a
commit 2aa680ede2
4 changed files with 78 additions and 8 deletions

View File

@@ -244,6 +244,8 @@ type Config struct {
GcCanceledInvoicesOnStartup bool `long:"gc-canceled-invoices-on-startup" description:"If true, we'll attempt to garbage collect canceled invoices upon start."`
GcCanceledInvoicesOnTheFly bool `long:"gc-canceled-invoices-on-the-fly" description:"If true, we'll delete newly canceled invoices on the fly."`
Routing *routing.Conf `group:"routing" namespace:"routing"`
Workers *lncfg.Workers `group:"workers" namespace:"workers"`