-
Notifications
You must be signed in to change notification settings - Fork 912
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
Feature: Add flag to waitanyinvoice
to immediately return or not.
#3192
Comments
If you design your application in that way, then if your application dies while
Rather than expose the latest |
To be clear, this is not what I suggested in the OP. However, I agree that exposing the |
waitanyinvoice
to immediately return or not.
… if no invoice available. Fixes: ElementsProject#3192 Changelog-Added: `waitanyinvoice` now supports an `immediate` flag, which when set will cause the command to fail immediately instead of blocking when no paid invoice is available.
… if no invoice available. Fixes: ElementsProject#3192 Changelog-Added: `waitanyinvoice` now supports an `immediate` flag, which when set will cause the command to fail immediately instead of blocking when no paid invoice is available.
Fixes: ElementsProject#3192 Changelog-Added: `waitanyinvoice` now supports a `timeout` parameter, which when set will cause the command to fail when the timeout is reached; can set this to 0 to fail immediately if no new invoice has been paid yet.
So, in the long run I prefer to move to a generic "watch" subscribe-style interface, by providing one or more serial numbers on each "list"able object. e.g. This gives several advantages:
But meanwhile, this change is useful. |
… if no invoice available. Fixes: ElementsProject#3192 Changelog-Added: `waitanyinvoice` now supports an `immediate` flag, which when set will cause the command to fail immediately instead of blocking when no paid invoice is available.
Modified by @ZmnSCPxj:
Add
immediate
argument towaitanyinvoice
to return with an error if no invoice beyond the givenlastpay_index
has been paid. This allows the requested behavior of applications to batch-process invoices that came in while the application was not running (see text below the divide) or for acrontab
process that regularly polls for new incoming payments, and so on.Original text by @jonasnick
As far as I can see right now there's no way to get the latest waitanyinvoice index. It may be useful for applications to get the index on startup and then call
waitanyinvoice
only on future invoices. Or yet other applications (my case) want to catch up with the latest received invoice before starting the web interface.The text was updated successfully, but these errors were encountered: