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: disconnect ldk peer before re-connecting #1150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Mar 5, 2025

Fixes #1113

@rolznz rolznz requested a review from im-adithya March 5, 2025 15:51
err := ls.node.Disconnect(connectPeerRequest.Pubkey)
if err != nil {
// non-critical: only log an error
logger.Logger.WithField("request", connectPeerRequest).WithError(err).Error("Disconnect failed while connecting peer")
Copy link
Contributor

Choose a reason for hiding this comment

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

this happens when we're not connected? or when could this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bumi I couldn't reproduce it in my testing, both connecting to an existing peer and connecting to a peer that was not currently connected. I looked at the ldk-node code and this can happen if persistence fails (which ideally never happens, if it does we have much bigger issues than disconnecting from a peer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: LDK reconnecting peer after IP address is not persisted
2 participants