mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-31 19:20:57 +02:00
[refactor] Use uint64_t and std namespace in PoissonNextSend
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
committed by
Martin Zumsande
parent
9e64d69bf7
commit
03cfa1b603
@@ -718,6 +718,6 @@ void RandomInit()
|
||||
|
||||
std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, std::chrono::seconds average_interval)
|
||||
{
|
||||
double unscaled = -log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */);
|
||||
double unscaled = -std::log1p(GetRand(uint64_t{1} << 48) * -0.0000000000000035527136788 /* -1/2^48 */);
|
||||
return now + std::chrono::duration_cast<std::chrono::microseconds>(unscaled * average_interval + 0.5us);
|
||||
}
|
||||
|
Reference in New Issue
Block a user