5#ifndef BITCOIN_NODE_TIMEOFFSETS_H
6#define BITCOIN_NODE_TIMEOFFSETS_H
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.
node::Warnings & m_warnings
bool WarnIfOutOfSync() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Raise warnings if the median time offset exceeds the warnings threshold.
std::chrono::seconds Median() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Compute and return the median of the collected time offset samples.
TimeOffsets(node::Warnings &warnings)
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.
static constexpr std::chrono::minutes WARN_THRESHOLD
Minimum difference between system and network time for a warning to be raised.
Manages warning messages within a node.
#define EXCLUSIVE_LOCKS_REQUIRED(...)