Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Make invoicer not generate an invoice if LND is not ready #37

Open
nolim1t opened this issue Jan 28, 2019 · 3 comments
Open

Make invoicer not generate an invoice if LND is not ready #37

nolim1t opened this issue Jan 28, 2019 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@nolim1t
Copy link
Member

nolim1t commented Jan 28, 2019

Just to make things more robust If synced_to_chain is false (usually after a LND restart) it should return a response saying it can't generate an invoice rather than hanging

@nolim1t nolim1t added bug Something isn't working enhancement New feature or request labels Jan 28, 2019
@meeDamian
Copy link
Member

The issue is the call to getinfo can sometimes take a few seconds (for so for undetermined reasons), and if I were to call it prior to every invoice generation call, it can slow it down significantly :/

But I agree it needs to be addressed somehow.

@nolim1t
Copy link
Member Author

nolim1t commented Jan 29, 2019

Maybe outsource it to the healthcheck endpoint. There may be uses for that still, but have the front end do some checks

@meeDamian
Copy link
Member

After putting some thought into it, I think it makes sense to have a goroutine calling lnd periodically, and:

If call worked, but now fails: suicide
If call returns not synced to chain tip: block API with some "not ready" error
If call worked, and synced to chain tip: remove the block.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants