mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-25 14:04:27 +00:00
Give hard-coded seed nodes a random last-seen time, to randomize order they're tried.
This commit is contained in:
parent
bca179e8bd
commit
86fd7c5af6
@ -1357,9 +1357,12 @@ void ThreadOpenConnections2(void* parg)
|
|||||||
{
|
{
|
||||||
// It'll only connect to one or two seed nodes because once it connects,
|
// It'll only connect to one or two seed nodes because once it connects,
|
||||||
// it'll get a pile of addresses with newer timestamps.
|
// 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;
|
CAddress addr;
|
||||||
addr.ip = pnSeed[i];
|
addr.ip = pnSeed[i];
|
||||||
addr.nTime = 0;
|
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
|
||||||
AddAddress(addr);
|
AddAddress(addr);
|
||||||
}
|
}
|
||||||
fSeedUsed = true;
|
fSeedUsed = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user