git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
4a17e3e
)
Give DNS seeds a random age between 3 and 7 days old
author
Pieter Wuille
<pieter.wuille@gmail.com>
Sun, 25 Mar 2012 14:06:16 +0000 (16:06 +0200)
committer
Pieter Wuille
<pieter.wuille@gmail.com>
Sun, 25 Mar 2012 14:06:16 +0000 (16:06 +0200)
This speeds up initial connections with an old/large addr.dat a lot.
src/net.cpp
patch
|
blob
|
history
diff --git
a/src/net.cpp
b/src/net.cpp
index
e9ec233
..
37e73c4
100644
(file)
--- 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++;
}