From 541b3c653d5408348089b34964d1055ee5dd4e09 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 29 Aug 2021 08:46:23 +0200 Subject: [PATCH] Enable 4-byte target format for diff up to 4 million --- src/stratum_server.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stratum_server.cpp b/src/stratum_server.cpp index aaf6a87..4383641 100644 --- a/src/stratum_server.cpp +++ b/src/stratum_server.cpp @@ -198,8 +198,8 @@ bool StratumServer::on_login(StratumClient* client, uint32_t id, const char* log log::hex_buf target_hex(reinterpret_cast(&target), sizeof(uint64_t)); - // Use short target format (4 bytes) for diff <= ~2 million - if ((target >> 32) >= 2147) { + // Use short target format (4 bytes) for diff <= ~4 million + if ((target >> 32) >= 1073) { target_hex.m_data += sizeof(uint32_t); target_hex.m_size -= sizeof(uint32_t); } @@ -392,8 +392,8 @@ void StratumServer::on_blobs_ready() { log::hex_buf target_hex(reinterpret_cast(&target), sizeof(uint64_t)); - // Use short target format (4 bytes) for diff <= ~2 million - if ((target >> 32) >= 2147) { + // Use short target format (4 bytes) for diff <= ~4 million + if ((target >> 32) >= 1073) { target_hex.m_data += sizeof(uint32_t); target_hex.m_size -= sizeof(uint32_t); }