From a61966ed61e693d6fbde073283798d10e82f1f8a Mon Sep 17 00:00:00 2001 From: SChernykh Date: Thu, 22 Dec 2022 11:48:50 +0100 Subject: [PATCH] Don't count shares that were found during sync --- src/stratum_server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stratum_server.cpp b/src/stratum_server.cpp index ce6f02b..5fa83b3 100644 --- a/src/stratum_server.cpp +++ b/src/stratum_server.cpp @@ -420,6 +420,13 @@ bool StratumServer::on_submit(StratumClient* client, uint32_t id, const char* jo share->m_hashes = (target > 1) ? udiv128(1, 0, target, &rem) : 1; share->m_highEnoughDifficulty = sidechain_diff.check_pow(resultHash); + // Don't count shares that were found during sync + const SideChain& side_chain = m_pool->side_chain(); + const PoolBlock* tip = side_chain.chainTip(); + if (tip && (sidechain_height + side_chain.chain_window_size() < tip->m_sidechainHeight)) { + share->m_highEnoughDifficulty = false; + } + update_auto_diff(client, share->m_timestamp, share->m_hashes); // If this share is below sidechain difficulty, process it in this thread because it'll be quick