Best (session): use only client.best_diff so it actually resets
Math.max(client.best_diff, worker.best_diff) defeated the whole
point of the column. ckpool keeps two separate counters:
stratum_instance.best_diff — per TCP session, in memory only,
freed on disconnect, gone on
ckpool restart.
worker_instance.best_diff — per worker name, persisted to the
logdir, restored on ckpool restart,
survives client disconnects.
Falling back to worker.best_diff when the client value was lower
meant the displayed "session" diff carried over the very events
(miner disconnect, pool restart) that should reset it.
Switch every "Best (session)" computation to read only the live
stratum_instance value. Offline workers — those with a worker
record but no current client — show 0, which is correct: there is
no current session to have a best in.
This commit is contained in:
@@ -49,12 +49,10 @@
|
||||
hashrate1m: (c?.dsps1 ?? w.dsps1) * 2 ** 32,
|
||||
hashrate1h: (c?.dsps60 ?? w.dsps60) * 2 ** 32,
|
||||
diff: c?.diff ?? w.mindiff,
|
||||
// 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),
|
||||
// Session best = ckpool's stratum_instance.best_diff for the
|
||||
// currently-connected client only. Resets on miner disconnect
|
||||
// and pool restart. 0 for offline workers (no current session).
|
||||
bestRound: c?.bestdiff ?? 0,
|
||||
bestEver: w.bestever,
|
||||
lastShare: c?.lastshare ?? w.lastshare,
|
||||
online: !!c,
|
||||
|
||||
Reference in New Issue
Block a user