diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-20 12:48:34 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-22 23:39:07 +0000 |
commit | d2fda6c25f476c45acbc875721106f965435d99f (patch) | |
tree | 57d87f47240d0d5526e83837cddb26cf4c88fbfa /src/common/util.cpp | |
parent | Merge pull request #7151 (diff) | |
download | monero-d2fda6c25f476c45acbc875721106f965435d99f.tar.xz |
restrict public node checks a little
do not include blocked hosts in peer lists or public node lists by default,
warn about no https on clearnet and about untrusted peers likely being spies
Diffstat (limited to '')
-rw-r--r-- | src/common/util.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp index f8707d65c..445a11a75 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -871,10 +871,19 @@ std::string get_nix_version_display_string() return max_concurrency; } + bool is_privacy_preserving_network(const std::string &address) + { + if (boost::ends_with(address, ".onion")) + return true; + if (boost::ends_with(address, ".i2p")) + return true; + return false; + } + 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")) + if (is_privacy_preserving_network(address)) { MDEBUG("Address '" << address << "' is Tor/I2P, non local"); return false; |