lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.69k stars 2.08k forks source link

[feature]: Add DeleteInvoice gRPC call #8161

Open rsafier opened 12 months ago

rsafier commented 12 months ago

Is your feature request related to a problem? Please describe. There is no equivalent to DeletePayment for Invoices. Without this developers are only left with two flags to assist in some form of cleanup for CANCELLED invoices which might not fit in with existing patterns well that need more granularity on what is purged from the node.

Describe the solution you'd like Expose DeleteInvoices gRPC call which would allow more granular removal of invoice data.

Describe alternatives you've considered

Adjusting existing process flows for gc-canceled-invoices-on-startup or gc-canceled-invoices-on-the-fly . This is not a major problem on fresh project but in existing workflows this can be significantly more work to fit into either of these options.

Additional context

ProofOfKeags commented 1 month ago

I'm taking a look at this right now. Should it only allow deletion if it's already been cancelled or do you want the call to implicitly also carry out the cancellation if it's not cancelled?

ProofOfKeags commented 1 month ago

Talked to @rsafier out of band. The planned semantics for this is to give an error if we try to delete an invoice that is not already cancelled.