mirror of
https://github.com/xmrig/xmrig.git
synced 2025-03-16 16:42:14 +00:00
Merge pull request #1887 from SChernykh/dev
Fixed total hashrate update
This commit is contained in:
commit
f85efd163c
1 changed files with 8 additions and 2 deletions
|
@ -143,6 +143,7 @@ void xmrig::Workers<T>::tick(uint64_t)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool totalAvailable = true;
|
||||||
uint64_t totalHashCount = 0;
|
uint64_t totalHashCount = 0;
|
||||||
|
|
||||||
for (Thread<T> *handle : m_workers) {
|
for (Thread<T> *handle : m_workers) {
|
||||||
|
@ -150,11 +151,16 @@ void xmrig::Workers<T>::tick(uint64_t)
|
||||||
uint64_t hashCount, timeStamp;
|
uint64_t hashCount, timeStamp;
|
||||||
handle->worker()->getHashrateData(hashCount, timeStamp);
|
handle->worker()->getHashrateData(hashCount, timeStamp);
|
||||||
d_ptr->hashrate->add(handle->id() + 1, hashCount, timeStamp);
|
d_ptr->hashrate->add(handle->id() + 1, hashCount, timeStamp);
|
||||||
totalHashCount += handle->worker()->rawHashes();
|
|
||||||
|
const uint64_t n = handle->worker()->rawHashes();
|
||||||
|
if (n == 0) {
|
||||||
|
totalAvailable = false;
|
||||||
|
}
|
||||||
|
totalHashCount += n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalHashCount > 0) {
|
if (totalAvailable) {
|
||||||
d_ptr->hashrate->add(0, totalHashCount, Chrono::steadyMSecs());
|
d_ptr->hashrate->add(0, totalHashCount, Chrono::steadyMSecs());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue