diff options
| author | Alexander Blair <snipa@jagtech.io> | 2020-12-26 13:41:41 -0800 |
|---|---|---|
| committer | Alexander Blair <snipa@jagtech.io> | 2020-12-26 13:41:42 -0800 |
| commit | d06bae56b33aad6b1c15584eda14f58510c41f34 (patch) | |
| tree | ebb56f73d9ea8e73d7dc146e0694afdc7e4f878e /src/common/util.cpp | |
| parent | 635ea3df2e77e49b3b60bed3cde91f5b65c12d2b (diff) | |
| parent | d2fda6c25f476c45acbc875721106f965435d99f (diff) | |
| download | monzero-core-d06bae56b33aad6b1c15584eda14f58510c41f34.tar.gz monzero-core-d06bae56b33aad6b1c15584eda14f58510c41f34.tar.xz monzero-core-d06bae56b33aad6b1c15584eda14f58510c41f34.zip | |
Merge pull request #7173
d2fda6c25 restrict public node checks a little (moneromooo-monero)
Diffstat (limited to 'src/common/util.cpp')
| -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; |
