aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-06-16 10:57:55 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-06-16 10:57:59 +0200
commit0a64777b909e7c29ae69a3fcf4d4e859ff375dec (patch)
treec9c14d787415e01af5955c457c30670938ebf70e /src/net.cpp
parentf7a403b4cf223dce740de829a72122655569845b (diff)
parentbc0a895d810107132651c8178e95a981b9f3ff74 (diff)
Merge #8208: Do not set extra flags for unfiltered DNS seed results
bc0a895 Do not set extra flags for unfiltered DNS seed results (Pieter Wuille)
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index a390eca776..5e791291c7 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1415,6 +1415,18 @@ void MapPort(bool)
+static std::string GetDNSHost(const CDNSSeedData& data, ServiceFlags* requiredServiceBits)
+{
+ //use default host for non-filter-capable seeds or if we use the default service bits (NODE_NETWORK)
+ if (!data.supportsServiceBitsFiltering || *requiredServiceBits == NODE_NETWORK) {
+ *requiredServiceBits = NODE_NETWORK;
+ return data.host;
+ }
+
+ return strprintf("x%x.%s", *requiredServiceBits, data.host);
+}
+
+
void ThreadDNSAddressSeed()
{
// goal: only query DNS seeds if address need is acute
@@ -1441,7 +1453,7 @@ void ThreadDNSAddressSeed()
std::vector<CNetAddr> vIPs;
std::vector<CAddress> vAdd;
ServiceFlags requiredServiceBits = nRelevantServices;
- if (LookupHost(seed.getHost(requiredServiceBits).c_str(), vIPs, 0, true))
+ if (LookupHost(GetDNSHost(seed, &requiredServiceBits).c_str(), vIPs, 0, true))
{
BOOST_FOREACH(const CNetAddr& ip, vIPs)
{