diff options
| author | Pieter Wuille <[email protected]> | 2012-03-25 16:06:16 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-03-25 16:06:16 +0200 |
| commit | bf1afb02cab1a08052f46845e437f2de9d29f55a (patch) | |
| tree | bc1396920214043b1872d60799f18839e2467e4f /src/net.cpp | |
| parent | Merge pull request #946 from luke-jr/bugfix_rm_mingw (diff) | |
| download | discoin-bf1afb02cab1a08052f46845e437f2de9d29f55a.tar.xz discoin-bf1afb02cab1a08052f46845e437f2de9d29f55a.zip | |
Give DNS seeds a random age between 3 and 7 days old
This speeds up initial connections with an old/large addr.dat a lot.
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index e9ec233a1..37e73c421 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++; } |