-
Notifications
You must be signed in to change notification settings - Fork 910
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
holdinvoice RPC plugin #6611
holdinvoice RPC plugin #6611
Conversation
@daywalker90 |
Thanks @evd0kim ! I applied the patch and also made the invoice descriptions in the tests unique so they are identifiable when testing. |
689b85f: While testing the integration with this new version and robosats i noticed the plugin is not doing anything if the invoice has no payment attempts and expires. Previously it returned the state OPEN even after such an invoice expired, but i think it makes more sense that it returns CANCELED instead. |
I found an inconsistency with lnds behaviour and this makes actually more sense: Plugin now switches to CANCELED if a htlc is close to expiry instead of back to OPEN. |
Also, i think i found another big problem: If while holding a htlc the channel gets force closed there is no way for me to settle the invoice anymore since when the plugin returns |
I could listen to I tried the force close case with lnd and i was able to settle the htlc onchain to myself in the block window between first evidence of a force close onchain and the htlc timeout height. |
31ac3b6
to
fe8fdf5
Compare
|
This was moved to the lightningd/plugins repository: lightningd/plugins#482 |
This PR introduces "holdinvoice", a rpc plugin that offer 4 methods to hold invoices as per @niftynei request #6358 (comment)
While doing this i improved the performance (almost 2 orders of magnitude less ressouces usage, the cpu usage was misleading in my grpc pr since lightningd was using quite a bit, which now it does not) and a bunch of other things in comparison to the earlier grpc version .
I also added some tests (they are not the best but cover some basic stuff) that i used in combination with 2 local regtest nodes.
Some things to note:
I'm still not certain if my values for
are good or not. Feedback welcome.