5 #ifndef BITCOIN_NODE_TIMEOFFSETS_H 6 #define BITCOIN_NODE_TIMEOFFSETS_H 49 #endif // BITCOIN_NODE_TIMEOFFSETS_H bool WarnIfOutOfSync() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Raise warnings if the median time offset exceeds the warnings threshold.
TimeOffsets(node::Warnings &warnings)
Manages warning messages within a node.
static constexpr std::chrono::minutes WARN_THRESHOLD
Minimum difference between system and network time for a warning to be raised.
void Add(std::chrono::seconds offset) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Add a new time offset sample.
static constexpr size_t MAX_SIZE
Maximum number of timeoffsets stored.
std::deque< std::chrono::seconds > m_offsets GUARDED_BY(m_mutex)
The observed time differences between our local clock and those of our outbound peers.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
node::Warnings & m_warnings
std::chrono::seconds Median() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Compute and return the median of the collected time offset samples.