Skip to content

Commit 001ae52

Browse files
committed
Fix desired version rates: use desired_version not share version
Graph was showing actual share versions (all V35 since chain is V35) instead of what miners signal they want (desired_version). Now uses shares_by_desired_version from the stats skiplist, which shows the V35→V36 transition progress correctly.
1 parent f7dd084 commit 001ae52

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/core/web_server.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6040,13 +6040,13 @@ void MiningInterface::update_stat_log()
60406040
}
60416041

60426042
// Desired version rates — p2pool: {version_str: hashrate}
6043+
// Uses desired_version (what miners signal they want) not share version (what's in the chain)
60436044
entry.desired_versions = nlohmann::json::object();
60446045
if (m_sharechain_stats_fn) {
60456046
auto sc = m_sharechain_stats_fn();
6046-
if (sc.contains("shares_by_version") && sc["shares_by_version"].is_object()) {
6047-
// Approximate: weight share version counts by pool hashrate
6047+
if (sc.contains("shares_by_desired_version") && sc["shares_by_desired_version"].is_object()) {
60486048
int total = sc.value("total_shares", 1);
6049-
for (auto& [ver, count] : sc["shares_by_version"].items()) {
6049+
for (auto& [ver, count] : sc["shares_by_desired_version"].items()) {
60506050
double pct = (total > 0) ? count.get<double>() / total : 0.0;
60516051
entry.desired_versions[ver] = entry.pool_hash_rate * pct;
60526052
}

0 commit comments

Comments
 (0)