Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Invoice RPC method #1510

Closed
tim2CF opened this issue Aug 10, 2020 · 9 comments
Closed

Delete Invoice RPC method #1510

tim2CF opened this issue Aug 10, 2020 · 9 comments

Comments

@tim2CF
Copy link

tim2CF commented Aug 10, 2020

Would be useful to have deleteinvoice RPC method (opposite to createinvoice) to be able to cleanup expired invoices

@t-bast
Copy link
Member

t-bast commented Aug 10, 2020

If we do it that way, this RPC should ensure it only deletes expired invoices.
The RPC could also have an option to say "delete all expired invoices".

I think an even more useful feature would be to automatically run a task every X hours (configurable in eclair.conf) that deletes all expired invoices from the DB. Users should be able to disable this if they want to keep their full history (for example by setting the frequency of these runs to -1 - or something cleaner like a separate bool). It should probably also run when starting the node (if enabled).

@t-bast
Copy link
Member

t-bast commented Aug 10, 2020

@dpad85 do you know if eclair-mobile / phoenix already have that kind of clean-up implemented? Would they benefit from it?

@dpad85
Copy link
Member

dpad85 commented Aug 11, 2020

Neither eclair mobile or phoenix have implemented such a feature, but it could be useful indeed.

@t-bast
Copy link
Member

t-bast commented Feb 8, 2021

Note that this issue should probably be done after #1640

@tim2CF
Copy link
Author

tim2CF commented Feb 10, 2021

Thanks, Bastien!

@tompro
Copy link
Contributor

tompro commented Feb 20, 2021

So reading this thread, I am not quite sure whether it should be a scheduled job with an enabler flag, an exposed endpoint or both?

@tim2CF
Copy link
Author

tim2CF commented Feb 20, 2021

I'm not familiar with internal Eclair architecture, but it feels that there might be 2 cases

  • There are no other API methods where expired invoices might be involved, then it feels more like internal feature ans should be enabled by flag
  • There are other API methods where expired invoices might be involved, then invoice removing should be completely in user's control through API method

@t-bast
Copy link
Member

t-bast commented Feb 21, 2021

So reading this thread, I am not quite sure whether it should be a scheduled job with an enabler flag, an exposed endpoint or both?

I think both would be useful (and should be separate PRs).
Cleaning up old expired invoices automatically always makes sense.
Choosing the delete a specific invoice (even if it's not expired) because you messed up something with it also makes sense.

@t-bast
Copy link
Member

t-bast commented Oct 20, 2021

Done in #1984

@t-bast t-bast closed this as completed Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants