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

Speed up actual response by subscribing to and caching lnd invoice settlement events #12

Open
philippgille opened this issue Aug 26, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@philippgille
Copy link
Owner

lnd's package lnrpc contains a function SubscribeInvoices() which allow an RPC client to subscribe to invoice events (creation, settlement). When subscribing to the settlement events, the web service containing the paywalled API could cache the settled invoices, so when the second request arrives with the preimage header, only the cache needs to be checked and then the response could immediately be sent, without having to send an RPC message to lnd to find out whether the corresponding invoice was settled.

This doesn't lead to less traffic between the web service and lnd, and might create some overhead on the web service, because it might cache some invoices that are never going to be "claimed" by any web service client, but the lowered request duration from the perspective of the client might still be worth it.

@philippgille philippgille added the enhancement New feature or request label Aug 26, 2018
@philippgille philippgille changed the title Speed up actual response by subscribing to lnd invoice settlement events Speed up actual response by subscribing to and caching lnd invoice settlement events Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant