mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
refactor: remove warnings globals
This commit is contained in:
parent
9c4b0b7ce4
commit
260f8da71a
27 changed files with 87 additions and 51 deletions
|
|
@ -48,7 +48,7 @@ bool TimeOffsets::WarnIfOutOfSync() const
|
|||
// when median == std::numeric_limits<int64_t>::min(), calling std::chrono::abs is UB
|
||||
auto median{std::max(Median(), std::chrono::seconds(std::numeric_limits<int64_t>::min() + 1))};
|
||||
if (std::chrono::abs(median) <= WARN_THRESHOLD) {
|
||||
node::g_warnings.Unset(node::Warning::CLOCK_OUT_OF_SYNC);
|
||||
m_warnings.Unset(node::Warning::CLOCK_OUT_OF_SYNC);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +61,6 @@ bool TimeOffsets::WarnIfOutOfSync() const
|
|||
"RPC methods to get more info."
|
||||
), Ticks<std::chrono::minutes>(WARN_THRESHOLD))};
|
||||
LogWarning("%s\n", msg.original);
|
||||
node::g_warnings.Set(node::Warning::CLOCK_OUT_OF_SYNC, msg);
|
||||
m_warnings.Set(node::Warning::CLOCK_OUT_OF_SYNC, msg);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue