mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge #8083: Add support for dnsseeds with option to filter by servicebits
2d83013d Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli)
This commit is contained in:
commit
cd0c5135ab
3 changed files with 18 additions and 4 deletions
|
|
@ -1464,12 +1464,13 @@ void ThreadDNSAddressSeed()
|
|||
} else {
|
||||
std::vector<CNetAddr> vIPs;
|
||||
std::vector<CAddress> vAdd;
|
||||
if (LookupHost(seed.host.c_str(), vIPs, 0, true))
|
||||
uint64_t requiredServiceBits = NODE_NETWORK;
|
||||
if (LookupHost(seed.getHost(requiredServiceBits).c_str(), vIPs, 0, true))
|
||||
{
|
||||
BOOST_FOREACH(const CNetAddr& ip, vIPs)
|
||||
{
|
||||
int nOneDay = 24*3600;
|
||||
CAddress addr = CAddress(CService(ip, Params().GetDefaultPort()));
|
||||
CAddress addr = CAddress(CService(ip, Params().GetDefaultPort()), requiredServiceBits);
|
||||
addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old
|
||||
vAdd.push_back(addr);
|
||||
found++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue