-
Notifications
You must be signed in to change notification settings - Fork 906
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
Paycodes #2794
Paycodes #2794
Conversation
Why doesn't a spontaneous plugin create an invoice, then pay it? That fits better with existing software, AFAICT? |
Paying an invoice triggers Since the plugin is likely to operate transiently, I opted to make paycodes into a memory-only structure that is explicitly not kept in database. Thus, not-well-written plugins will not uselessly waste disk space on invoices they end up not paying for various reasons. |
Couldn't the same thing be achieved by using the |
Yes, the same can be done with
Writing a single plugin to do all of the above would be unwieldy (and would break single responsibility principle). At least with |
Absolutely agree, we shouldn't force users to combine these things into a single plugin. I had envisioned more of a chain-of-responsibility pattern being implemented as a top-level plugin that could then run a number of sub-plugins and combine their decisions into a single final decision to pass up to Would maybe a notification be sufficient for your use-cases as well? That'd be truly trivial to implement, and if desired we could extend the notifications to the JSON-RPC as well (though we might need to deal with high-watermarks in that case in order not to miss notifications). That seems slightly more desirable than a long-polling RPC call alone. |
Please see #2796 . I would prefer the chain-of-responsibility be at the
The advantage of |
If you don't partition your invoices somehow you'll always have problems with others. This is no different. We really, really, really want invoices and payments to balance. No matter if the invoice is generated spontaneously, this gives documentation to exactly what's happening, and doesn't require any new infrastructure (AFAICT). |
So what is the plan now? Add a |
No, I would just close this. Labels are free-form strings: I'd suggest a spontaneous plugin prepend "spontaneous-plugin" to the label they generate for the invoice. Problem solved. |
FWIW, Lightning Charge would handle unknown invoices coming from As for Spark, this will pop up as a new incoming payment notification and add the paid invoice to the list of incoming payments. Which is kinda weird, I guess. How would you suggest to handle this? |
@shesek have Spark keep track of its own-generated invoices? What is intent of Spark? |
@ZmnSCPxj Spark is a wallet GUI for c-lightning. Its intentionally stateless, relies entirely on the rpc and has no db of its own, so there's currently no easy way to keep track of this. |
Implement
waitnewpaycode
command, which allows node to receive without triggeringwaitanyinvoice
.Intent is to be used by self-paying plugins without potentially interfering with merchant software that is polling
waitanyinvoice
.Needs test.
Fixes #2666