Open nolim1t opened 5 years ago
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.
Maybe outsource it to the healthcheck endpoint. There may be uses for that still, but have the front end do some checks
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.
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