mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-22 14:32:54 -05:00
Fix HashrateInterpolator::addDataPoint
This commit is contained in:
@@ -55,11 +55,9 @@ void xmrig::HashrateInterpolator::addDataPoint(uint64_t count, uint64_t timeStam
|
|||||||
std::lock_guard<std::mutex> l(m_lock);
|
std::lock_guard<std::mutex> l(m_lock);
|
||||||
|
|
||||||
// Clean up old data
|
// Clean up old data
|
||||||
if (!m_data.empty()) {
|
while (!m_data.empty() && (timeStamp - m_data.front().second > LagMS * 2)) {
|
||||||
while (timeStamp - m_data.front().second > LagMS * 2) {
|
|
||||||
m_data.pop_front();
|
m_data.pop_front();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_data.emplace_back(count, timeStamp);
|
m_data.emplace_back(count, timeStamp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user