From 260f8da71a35232d859d7705861fc1a88bfbbe81 Mon Sep 17 00:00:00 2001 From: stickies-v Date: Tue, 7 May 2024 14:21:35 +0100 Subject: refactor: remove warnings globals --- src/node/timeoffsets.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/node/timeoffsets.h') diff --git a/src/node/timeoffsets.h b/src/node/timeoffsets.h index 2b12584e12..eba706ac1e 100644 --- a/src/node/timeoffsets.h +++ b/src/node/timeoffsets.h @@ -11,8 +11,16 @@ #include #include +namespace node { +class Warnings; +} // namespace node + class TimeOffsets { +public: + TimeOffsets(node::Warnings& warnings) : m_warnings{warnings} {} + +private: //! Maximum number of timeoffsets stored. static constexpr size_t MAX_SIZE{50}; //! Minimum difference between system and network time for a warning to be raised. @@ -23,6 +31,8 @@ class TimeOffsets * positive offset means our peer's clock is ahead of our local clock. */ std::deque m_offsets GUARDED_BY(m_mutex){}; + node::Warnings& m_warnings; + public: /** Add a new time offset sample. */ void Add(std::chrono::seconds offset) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex); -- cgit v1.2.3