Skip to content

Comments

Fix total hashrate and hashrate chart#14

Open
pavlenex wants to merge 3 commits intostratum-mining:mainfrom
pavlenex:adoring-feynman
Open

Fix total hashrate and hashrate chart#14
pavlenex wants to merge 3 commits intostratum-mining:mainfrom
pavlenex:adoring-feynman

Conversation

@pavlenex
Copy link
Contributor

Vibe-coded prototype attempt to fix total hashrate counter and hashrate history chart. This is a proof of concept.
Screenshot 2026-02-23 at 10 37 42

Related #11 #12

@pavlenex pavlenex marked this pull request as draft February 23, 2026 07:03
@pavlenex pavlenex requested a review from GitGab19 February 23, 2026 14:17
@pavlenex pavlenex marked this pull request as ready for review February 23, 2026 14:17
</div>
</div>

<div className="flex items-center gap-2 w-full sm:w-auto justify-end">
Copy link
Contributor Author

@pavlenex pavlenex Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh buttons aren't functional and since I believe we hot refresh data I removed them.

Comment on lines +96 to +107
// Total hashrate, with multiple fallback sources:
// - JD mode: sv2_clients summary → client channel nominal hashrates
// - Translator-only mode: sv1_clients summary → individual client sum → server reported total
// Use nullish coalescing so an explicit 0 hashrate is preserved.
const totalHashrate = isJdMode
? (poolGlobal?.sv2_clients?.total_hashrate ?? clientChannelHashrate ?? 0)
: (
poolGlobal?.sv1_clients?.total_hashrate
?? (sv1Data ? sv1TotalHashrate : undefined)
?? poolGlobal?.server?.total_hashrate
?? 0
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one needs to be reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant