Skip to content

Option to auto connect to onion-supporting peers#98

Open
orbitalturtle wants to merge 6 commits intomasterfrom
auto-connect
Open

Option to auto connect to onion-supporting peers#98
orbitalturtle wants to merge 6 commits intomasterfrom
auto-connect

Conversation

@orbitalturtle
Copy link
Collaborator

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.

}
}

/// connect_to_onion_peers picks a few random nodes from the network graph that support onion messenging, then
Copy link
Contributor

Choose a reason for hiding this comment

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

messenging -> messaging or messages ?

Ok(())
}

/// get_onion_peers picks a few onion-messenging-supporting nodes from the network graph.
Copy link
Contributor

Choose a reason for hiding this comment

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

messenging -> messaging or messages ?

for peer in onion_peers.iter() {
connector
.connect_peer(peer.0.clone(), peer.1.clone())
.await?
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@dunxen dunxen self-requested a review August 31, 2024 15:17
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.

2 participants