5 #ifndef FABCOIN_TIMEDATA_H 6 #define FABCOIN_TIMEDATA_H 13 static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70 * 60;
32 vValues.reserve(_size);
33 vValues.push_back(initial_value);
39 if (vValues.size() ==
nSize) {
40 vValues.erase(vValues.begin());
42 vValues.push_back(value);
44 vSorted.resize(vValues.size());
45 std::copy(vValues.begin(), vValues.end(), vSorted.begin());
46 std::sort(vSorted.begin(), vSorted.end());
51 int vSortedSize = vSorted.size();
55 return vSorted[vSortedSize / 2];
58 return (vSorted[vSortedSize / 2 - 1] + vSorted[vSortedSize / 2]) / 2;
64 return vValues.size();
78 #endif // FABCOIN_TIMEDATA_H void AddTimeData(const CNetAddr &ip, int64_t nTime)
assert(len-trim+(2 *lenIndices)<=WIDTH)
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))