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

fix: show LND info while it is out of sync #1294

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

michael1011
Copy link
Contributor

Closes #1276

@michael1011 michael1011 added lightning Lightning network & lnd integration command line (CLI) Relating to the command line interface tools labels Oct 14, 2019
@michael1011 michael1011 requested review from a user, sangaman and kilrau October 14, 2019 14:11
@michael1011 michael1011 self-assigned this Oct 14, 2019
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know what you think of these suggestions, thanks.

lib/lndclient/LndClient.ts Show resolved Hide resolved
@@ -238,7 +236,10 @@ class LndClient extends SwapClient {
uris = getInfoResponse.getUrisList();
version = getInfoResponse.getVersion();
alias = getInfoResponse.getAlias();
if (channels.active <= 0) {

if (!this.isConnected()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to add a new isOutOfSync() method for SwapClient and check that here, then throw a new error OUT_OF_SYNC instead of UNAVAILABLE. That way callers can tell whether lnd is actually unavailable/offline or if it's up but simply out of sync and not ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this.status in errors.UNAVAILABLE(this.currency, this.status).message the error message already shows that LND is out of sync.

I agree on isOutOfSync() but don't think that a new error is necessary because of the reason stated above.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I overlooked that.

@michael1011 michael1011 force-pushed the lnd-info-while-syncing branch from 8529f34 to 485aa8f Compare October 17, 2019 16:07
@michael1011 michael1011 merged commit 8fc6096 into master Oct 17, 2019
@michael1011 michael1011 deleted the lnd-info-while-syncing branch October 17, 2019 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command line (CLI) Relating to the command line interface tools lightning Lightning network & lnd integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getinfo should show lnd info when it's syncing
2 participants