git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
bca179e
)
Give hard-coded seed nodes a random last-seen time, to randomize order they're tried.
author
Gavin Andresen
<gavinandresen@gmail.com>
Fri, 2 Sep 2011 15:01:45 +0000 (11:01 -0400)
committer
Gavin Andresen
<gavinandresen@gmail.com>
Fri, 2 Sep 2011 15:01:45 +0000 (11:01 -0400)
src/net.cpp
patch
|
blob
|
history
diff --git
a/src/net.cpp
b/src/net.cpp
index
1655cfb
..
952102e
100644
(file)
--- a/
src/net.cpp
+++ b/
src/net.cpp
@@
-1357,9
+1357,12
@@
void ThreadOpenConnections2(void* parg)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
+ // Seed nodes are given a random 'last seen time' of between one and two
+ // weeks ago.
+ const int64 nOneWeek = 7*24*60*60;
CAddress addr;
addr.ip = pnSeed[i];
- addr.nTime = 0;
+ addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
fSeedUsed = true;