5#ifndef BITCOIN_TIMEDATA_H
6#define BITCOIN_TIMEDATA_H
58 return left / 2 + right / 2 + (left & right & 1);
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
std::chrono::time_point< NodeClock > time_point
static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT
int64_t GetTimeOffset()
Functions to keep track of adjusted P2P time.
void TestOnlyResetTimeData()
Reset the internal state of GetTimeOffset(), GetAdjustedTime() and AddTimeData().
NodeClock::time_point GetAdjustedTime()
void AddTimeData(const CNetAddr &ip, int64_t nTime)