mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
[doc] Provide rationale for randomization in scheduling.
This commit is contained in:
parent
9c8a55d9cb
commit
1f94bb0c74
1 changed files with 2 additions and 1 deletions
|
@ -825,7 +825,8 @@ void PeerLogicValidation::ReattemptInitialBroadcast(CScheduler& scheduler) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// schedule next run for 10-15 minutes in the future
|
// Schedule next run for 10-15 minutes in the future.
|
||||||
|
// We add randomness on every cycle to avoid the possibility of P2P fingerprinting.
|
||||||
const std::chrono::milliseconds delta = std::chrono::minutes{10} + GetRandMillis(std::chrono::minutes{5});
|
const std::chrono::milliseconds delta = std::chrono::minutes{10} + GetRandMillis(std::chrono::minutes{5});
|
||||||
scheduler.scheduleFromNow([&] { ReattemptInitialBroadcast(scheduler); }, delta);
|
scheduler.scheduleFromNow([&] { ReattemptInitialBroadcast(scheduler); }, delta);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue