6 #ifndef RAVEN_TIMEDATA_H 7 #define RAVEN_TIMEDATA_H 14 static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70 * 60;
33 vValues.reserve(_size);
34 vValues.push_back(initial_value);
40 if (vValues.size() ==
nSize) {
41 vValues.erase(vValues.begin());
43 vValues.push_back(value);
45 vSorted.resize(vValues.size());
46 std::copy(vValues.begin(), vValues.end(), vSorted.begin());
47 std::sort(vSorted.begin(), vSorted.end());
52 int vSortedSize = vSorted.size();
53 assert(vSortedSize > 0);
56 return vSorted[vSortedSize / 2];
59 return (vSorted[vSortedSize / 2 - 1] + vSorted[vSortedSize / 2]) / 2;
65 return vValues.size();
79 #endif // RAVEN_TIMEDATA_H void AddTimeData(const CNetAddr &ip, int64_t nTime)
int64_t GetTimeOffset()
Functions to keep track of adjusted P2P time.
int64_t GetAdjustedTime()
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))