Unify best-share semantics across leaderboard / miners / user page
BestShares read worker.bestdiff for its "Best (round)" column,
while MinersTable used client.bestdiff for online workers (and
worker.bestdiff only as a fallback for offline ones). ckpool
resets *both* fields in reset_bestshares() when the pool finds a
block, but reconnect / timing can leave them briefly divergent,
so the same worker could show different values in the two tables.
Switch every "session best" display to the same computation:
max(client.bestdiff, worker.bestdiff)
…picking whichever is currently higher. Relabel the column from
"Best (round)" to "Best (session)" in MinersTable, BestShares, and
UserDetailPage so the meaning matches the value. UserDetailPage's
per-user summary tile used to show the user's round-best as a
sub-line; drop it, since it contradicts the "session" framing at
the row level.
Net effect: scroll between the leaderboard and the miners table
and the same worker's best-share number stays put.
This commit is contained in:
@@ -49,7 +49,12 @@
|
||||
hashrate1m: (c?.dsps1 ?? w.dsps1) * 2 ** 32,
|
||||
hashrate1h: (c?.dsps60 ?? w.dsps60) * 2 ** 32,
|
||||
diff: c?.diff ?? w.mindiff,
|
||||
bestRound: c?.bestdiff ?? w.bestdiff,
|
||||
// Session best = larger of client.bestdiff (this stratum
|
||||
// connection) and worker.bestdiff (this worker in the
|
||||
// current round). Matches the MinersTable / BestShares
|
||||
// leaderboard semantics so values are consistent across
|
||||
// screens.
|
||||
bestRound: Math.max(c?.bestdiff ?? 0, w.bestdiff),
|
||||
bestEver: w.bestever,
|
||||
lastShare: c?.lastshare ?? w.lastshare,
|
||||
online: !!c,
|
||||
@@ -138,7 +143,7 @@
|
||||
<div class="card">
|
||||
<div class="stat-label">Best share (ever)</div>
|
||||
<div class="stat-value">{formatDifficulty(totals.bestEver || totals.bestDiff)}</div>
|
||||
<div class="stat-sub">round best {formatDifficulty(totals.bestDiff)}</div>
|
||||
<div class="stat-sub">across all this user's workers</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="stat-label">Workers</div>
|
||||
@@ -166,7 +171,7 @@
|
||||
<th class="num">Hashrate (1m)</th>
|
||||
<th class="num">Hashrate (1h)</th>
|
||||
<th class="num">Diff</th>
|
||||
<th class="num">Best (round)</th>
|
||||
<th class="num">Best (session)</th>
|
||||
<th class="num">Best (ever)</th>
|
||||
<th class="num">Last share</th>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user