Option to auto connect to onion-supporting peers#98
Open
orbitalturtle wants to merge 6 commits intomasterfrom
Open
Option to auto connect to onion-supporting peers#98orbitalturtle wants to merge 6 commits intomasterfrom
orbitalturtle wants to merge 6 commits intomasterfrom
Conversation
4500b35 to
0c1c532
Compare
kannapoix
reviewed
Aug 8, 2024
| } | ||
| } | ||
|
|
||
| /// connect_to_onion_peers picks a few random nodes from the network graph that support onion messenging, then |
Contributor
There was a problem hiding this comment.
messenging -> messaging or messages ?
| Ok(()) | ||
| } | ||
|
|
||
| /// get_onion_peers picks a few onion-messenging-supporting nodes from the network graph. |
Contributor
There was a problem hiding this comment.
messenging -> messaging or messages ?
| for peer in onion_peers.iter() { | ||
| connector | ||
| .connect_peer(peer.0.clone(), peer.1.clone()) | ||
| .await? |
Contributor
There was a problem hiding this comment.
Does the connect peer API return an error if LND fails to connect to a peer?
In my testing, LNDK doesn't print error logs on connection failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements part of #88, by introducing a config option users can turn on to automatically connect to random onion-supporting peers using the network graph.
Also squeezed in a couple of typo fixes.
I think a good followup would be to try to reconnect to other onion-supporting peers once the number of onion-supporting peers falls below a certain threshold. So something like, once we receive a disconnect event, we check how many remaining onion-supporting peers there are and connect accordingly.