5#ifndef BITCOIN_TIMEDATA_H
6#define BITCOIN_TIMEDATA_H
33 vValues.push_back(initial_value);
49 int vSortedSize =
vSorted.size();
51 if (vSortedSize & 1) {
53 return vSorted[vSortedSize / 2];
56 auto left =
vSorted[vSortedSize / 2 - 1];
57 auto right =
vSorted[vSortedSize / 2];
58 return left / 2 + right / 2 + (left & right & 1);
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)