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

make Monero understand Tor seeds, and add one #6874

Closed

Conversation

moneromooo-monero
Copy link
Collaborator

No description provided.


if (boost::ends_with(host, ".onion"))
{
epee::net_utils::network_address na{MONERO_UNWRAP(net::tor_address::make(host, (uint16_t)atoi(port.c_str())))}; // gets us 0 if not an integer, works for me
Copy link
Contributor

Choose a reason for hiding this comment

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

atoi doesn't handle well "out of int range" case, the result is undefined.

Copy link
Contributor

@vtnerd vtnerd left a comment

Choose a reason for hiding this comment

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

This should be inconsistent for Tor seed node connections. connect_to_seed() does not take a zone argument, so it only selects Tor seeds by "chance" when connections_maker() determines the IP address connection count is too low. I believe both of those functions need updating.

I would not close this PR so that the Tor address is linked to a commit+PR from you. I will update those functions in a separate PR (assuming you didn't want to) - I'm obligated via the CCS proposal anyway.


if (boost::ends_with(host, ".onion"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This section is now net::get_network_address but without i2p support. Calling that function would require re-splitting host/port (that function does it internally too) if addr is a hostname, but this section should be called infrequently anyway.

This section should be easier if get_seed_nodes() returns a std::vector<network_address>, I'll look into this.

@moneromooo-monero
Copy link
Collaborator Author

moneromooo-monero commented Oct 10, 2020

Thanks, I guess I'll readd the seed once you've done those changes.
And I'd tested by removing all the seeds except that one, so it'd always select it.

@moneromooo-monero
Copy link
Collaborator Author

Obsoleted by #7068

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.

4 participants