From 2a0b127048b839ff0d94f3952b02434bc4d852d0 Mon Sep 17 00:00:00 2001 From: frstrtr Date: Tue, 23 Jun 2026 23:06:05 +0000 Subject: [PATCH] web: collapse triplicated share_version switch in rest_web_currency_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rest_web_currency_info() set result["share_version"] via three byte-for-byte identical switch(m_blockchain) blocks back to back — a merge artifact. The second and third are pure dead code: each rewrites the key the prior block already set to the same value. Collapse to a single block. No behavior change (the emitted JSON is identical); removes 22 lines of redundant code on the web/API layer. --- src/core/web_server.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/core/web_server.cpp b/src/core/web_server.cpp index 97fc42da0..1bfe9508e 100644 --- a/src/core/web_server.cpp +++ b/src/core/web_server.cpp @@ -4772,28 +4772,6 @@ nlohmann::json MiningInterface::rest_web_currency_info() default: result["share_version"] = 36; break; } - // p2pool share version for the current coin — consumed by the - // bundled @c2pool/sharechain-explorer to classify share cells. - // Dash = v16, LTC/DOGE/BTC = v36. - switch (m_blockchain) { - case Blockchain::DASH: result["share_version"] = 16; break; - case Blockchain::LITECOIN: - case Blockchain::BITCOIN: - case Blockchain::DOGECOIN: - default: result["share_version"] = 36; break; - } - - // p2pool share version for the current coin — consumed by the - // bundled @c2pool/sharechain-explorer to classify share cells. - // Dash = v16, LTC/DOGE/BTC = v36. - switch (m_blockchain) { - case Blockchain::DASH: result["share_version"] = 16; break; - case Blockchain::LITECOIN: - case Blockchain::BITCOIN: - case Blockchain::DOGECOIN: - default: result["share_version"] = 36; break; - } - // ─── Per-coin explorer map (operator 2026-06-23: each coin = a distinct // blockchain). On merged-mining nodes (e.g. LTC primary + DOGE aux) the // dashboard switcher must link each coin's blocks/txs/addresses to the