diff options
| author | Gavin Andresen <[email protected]> | 2011-09-02 11:01:45 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-09-02 11:01:45 -0400 |
| commit | 86fd7c5af6cf3f907c50cf25ff844cd23e271c70 (patch) | |
| tree | 54304a4e9ade0954c9c7b039b63ff42dcb6c8531 /src/net.cpp | |
| parent | Update the list of seednodes. (diff) | |
| download | discoin-86fd7c5af6cf3f907c50cf25ff844cd23e271c70.tar.xz discoin-86fd7c5af6cf3f907c50cf25ff844cd23e271c70.zip | |
Give hard-coded seed nodes a random last-seen time, to randomize order they're tried.
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 1655cfbdc..952102ede 100644 --- 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; |