mirror of
https://github.com/xmrig/xmrig.git
synced 2025-02-02 11:16:37 +00:00
Fix HashrateInterpolator::addDataPoint
This commit is contained in:
parent
3fbf2ac3d4
commit
22a69f70da
1 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue