1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-10 01:02:40 -05:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Gevorg Hindoyan
c2e00963f5 Merge b60616a7ad into 8084ff37a5 2024-01-25 09:27:51 +04:00
hingev
b60616a7ad Fix summary API endpoint returning corrupted JSON
Upon startup, until statistics for all intervals were available, the
http response for the `summary` endpoint would be corrupted.
2024-01-25 00:25:28 +04:00

View File

@@ -48,7 +48,7 @@ public:
~Hashrate();
inline double calc(size_t ms) const { const double data = hashrate(0U, ms); return std::isnormal(data) ? data : 0.0; }
inline double calc(size_t threadId, size_t ms) const { return hashrate(threadId + 1, ms); }
inline double calc(size_t threadId, size_t ms) const { const double data = hashrate(threadId + 1, ms); return std::isnormal(data) ? data : 0.0; }
inline size_t threads() const { return m_threads > 0U ? m_threads - 1U : 0U; }
inline void add(size_t threadId, uint64_t count, uint64_t timestamp) { addData(threadId + 1U, count, timestamp); }
inline void add(uint64_t count, uint64_t timestamp) { addData(0U, count, timestamp); }