mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
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)
This commit is contained in:
commit
0a64777b90
@ -16,14 +16,6 @@
|
|||||||
|
|
||||||
#include "chainparamsseeds.h"
|
#include "chainparamsseeds.h"
|
||||||
|
|
||||||
std::string CDNSSeedData::getHost(uint64_t requiredServiceBits) const {
|
|
||||||
//use default host for non-filter-capable seeds or if we use the default service bits (NODE_NETWORK)
|
|
||||||
if (!supportsServiceBitsFiltering || requiredServiceBits == NODE_NETWORK)
|
|
||||||
return host;
|
|
||||||
|
|
||||||
return strprintf("x%x.%s", requiredServiceBits, host);
|
|
||||||
}
|
|
||||||
|
|
||||||
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
||||||
{
|
{
|
||||||
CMutableTransaction txNew;
|
CMutableTransaction txNew;
|
||||||
|
@ -13,11 +13,9 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class CDNSSeedData {
|
struct CDNSSeedData {
|
||||||
public:
|
|
||||||
std::string name, host;
|
std::string name, host;
|
||||||
bool supportsServiceBitsFiltering;
|
bool supportsServiceBitsFiltering;
|
||||||
std::string getHost(uint64_t requiredServiceBits) const;
|
|
||||||
CDNSSeedData(const std::string &strName, const std::string &strHost, bool supportsServiceBitsFilteringIn = false) : name(strName), host(strHost), supportsServiceBitsFiltering(supportsServiceBitsFilteringIn) {}
|
CDNSSeedData(const std::string &strName, const std::string &strHost, bool supportsServiceBitsFilteringIn = false) : name(strName), host(strHost), supportsServiceBitsFiltering(supportsServiceBitsFilteringIn) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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()
|
void ThreadDNSAddressSeed()
|
||||||
{
|
{
|
||||||
// goal: only query DNS seeds if address need is acute
|
// goal: only query DNS seeds if address need is acute
|
||||||
@ -1441,7 +1453,7 @@ void ThreadDNSAddressSeed()
|
|||||||
std::vector<CNetAddr> vIPs;
|
std::vector<CNetAddr> vIPs;
|
||||||
std::vector<CAddress> vAdd;
|
std::vector<CAddress> vAdd;
|
||||||
ServiceFlags requiredServiceBits = nRelevantServices;
|
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)
|
BOOST_FOREACH(const CNetAddr& ip, vIPs)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user