util: consider Tor/I2P addresses to be non local

pull/88/head
moneromooo-monero 6 years ago
parent 85d2ae4ad7
commit 082e0a1bef
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -657,6 +657,13 @@ std::string get_nix_version_display_string()
bool is_local_address(const std::string &address)
{
// always assume Tor/I2P addresses to be untrusted by default
if (boost::ends_with(address, ".onion") || boost::ends_with(address, ".i2p"))
{
MDEBUG("Address '" << address << "' is Tor/I2P, non local");
return false;
}
// extract host
epee::net_utils::http::url_content u_c;
if (!epee::net_utils::parse_url(address, u_c))

Loading…
Cancel
Save