aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-03-25 17:47:54 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2012-03-25 17:47:54 -0700
commit6eb339fae4920fb13d9ad8944fa1843dcc8f7217 (patch)
treeb7d863a9125f737711e07c0e3b5ff62cef4aa638
parentb3dbab33ca00e6fe959898558bb59845ca246f21 (diff)
parentbf1afb02cab1a08052f46845e437f2de9d29f55a (diff)
Merge pull request #984 from sipa/youngseeds
Give DNS seeds a random age between 3 and 7 days old
-rw-r--r--src/net.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e9ec233a13..37e73c421a 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1093,8 +1093,9 @@ void ThreadDNSAddressSeed2(void* parg)
{
BOOST_FOREACH(CNetAddr& ip, vaddr)
{
+ int nOneDay = 24*3600;
CAddress addr = CAddress(CService(ip, GetDefaultPort()));
- addr.nTime = 0;
+ addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old
vAdd.push_back(addr);
found++;
}