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

Update scanning state of NeutrinoClient #974

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion chain/neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,18 @@ out:

case err := <-rescanErr:
if err != nil {
log.Errorf("Neutrino rescan ended with error: %s", err)
log.Errorf("Neutrino rescan ended with "+
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we know what the error is? What is the root cause?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am trying to obtain the logs from the user, but I think his node is generally working fine, my next step will be to let the user run the patch to see if that fixes the problem. But as Oliver and Laolu pointed out, this code part needs a refactor.

"error: %s", err)
}

// We need to signal to the client that the rescan
// has finished otherwise updates to the rescan
// object will fail.
log.Info("Neutrino rescan finished")
s.clientMtx.Lock()
s.scanning = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we don't know what caused the rescan error, this will just create a new scan and then getting the same error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure, basically the link failed because the NewAddress (NotifiedReceived) returned an error when registering the wtclient for a specific link:

https://github.com/lightningnetwork/lnd/blob/6bf895aeb929fb64265bfb226f796392921d8d3a/htlcswitch/link.go#L544-L550

user at least reported that now the link is active, so seems like the backend still works correctly maybe some error failed the rescan and now we need to just restart it, but yeah let's hope we get more information from the user.

s.clientMtx.Unlock()

case s.currentBlock <- bs:

case <-s.quit:
Expand Down