From 874cff3d517ba52ddb5cc02a6581aa15d935a924 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 3 Mar 2020 17:53:19 +0100 Subject: [PATCH] Fixed new block detection for Dero solo mining --- src/base/net/stratum/DaemonClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/base/net/stratum/DaemonClient.cpp b/src/base/net/stratum/DaemonClient.cpp index edae8beb6..a27f9d826 100644 --- a/src/base/net/stratum/DaemonClient.cpp +++ b/src/base/net/stratum/DaemonClient.cpp @@ -269,6 +269,12 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value ¶ms, int *code) m_blocktemplate = std::move(blocktemplate); m_prevHash = Json::getString(params, "prev_hash"); + if (m_apiVersion == API_DERO) { + // Truncate to 32 bytes to have the same data as in get_info RPC + if (m_prevHash.size() > 64) + m_prevHash.data()[64] = '\0'; + } + if (m_state == ConnectingState) { setState(ConnectedState); }