From a81b3cc0b9fc87985e2462cd4bacb045e5dd231e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 4 Nov 2024 08:11:59 +0300 Subject: [PATCH] Merge fix --- src/core/MoBenchmark.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/MoBenchmark.cpp b/src/core/MoBenchmark.cpp index f7af4be81d..be20ba2776 100644 --- a/src/core/MoBenchmark.cpp +++ b/src/core/MoBenchmark.cpp @@ -218,9 +218,12 @@ void MoBenchmark::onJobResult(const JobResult& result) { for (auto backend : m_controller->miner()->backends()) { const Hashrate *hr = backend->hashrate(); if (!hr) continue; - t[0] += hr->calc(Hashrate::ShortInterval); - t[1] += hr->calc(Hashrate::MediumInterval); - t[2] += hr->calc(Hashrate::LargeInterval); + auto hr_pair = hr->calc(Hashrate::ShortInterval); + if (hr_pair.first) t[0] += hr_pair.second; + hr_pair = hr->calc(Hashrate::MediumInterval) + if (hr_pair.first) t[1] += hr_pair.second; + hr_pair = hr->calc(Hashrate::LargeInterval) + if (hr_pair.first) t[2] += hr_pair.second; } double hashrate = 0.0f; if (!(hashrate = t[2]))