Fix HashrateInterpolator::addDataPoint

This commit is contained in:
SChernykh 2020-10-10 11:22:19 +02:00
parent 3fbf2ac3d4
commit 22a69f70da

View file

@ -55,10 +55,8 @@ void xmrig::HashrateInterpolator::addDataPoint(uint64_t count, uint64_t timeStam
std::lock_guard<std::mutex> l(m_lock);
// Clean up old data
if (!m_data.empty()) {
while (timeStamp - m_data.front().second > LagMS * 2) {
m_data.pop_front();
}
while (!m_data.empty() && (timeStamp - m_data.front().second > LagMS * 2)) {
m_data.pop_front();
}
m_data.emplace_back(count, timeStamp);