From b25e5449c87f206e18a7049945bb847271200aa5 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 26 Jun 2022 17:07:19 +0200 Subject: [PATCH] Fixed rare "low diff share" errors --- src/stratum_server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stratum_server.cpp b/src/stratum_server.cpp index 56e1f40..04bc1d1 100644 --- a/src/stratum_server.cpp +++ b/src/stratum_server.cpp @@ -388,7 +388,8 @@ bool StratumServer::on_submit(StratumClient* client, uint32_t id, const char* jo } if (target >= TARGET_4_BYTES_LIMIT) { - target = (target >> 32) << 32; + // "Low diff share" fix: adjust target to the same value as XMRig would use + target = std::numeric_limits::max() / (std::numeric_limits::max() / (target >> 32)); } share->m_req.data = share;