mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Do not set extra flags for unfiltered DNS seed results
This commit is contained in:
14
src/net.cpp
14
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user