Skip to content

Division by 0 when building #39

@pdath

Description

@pdath

I can get a division-by-0 error when running "pnpm build" on a pool with no workers. I believe it is related to when the pool.status file (from ckpool) has either "Users" equal to 0, or "Workers" equal to 0.

Below is an example pool.status that was causing the build error to happen.

{"runtime": 695434, "lastupdate": 1771831503, "Users": 0, "Workers": 0, "Idle": 0, "Disconnected": 0}
{"hashrate1m": "0", "hashrate5m": "0", "hashrate15m": "0", "hashrate1hr": "0", "hashrate6hr": "0", "hashrate1d": "116M", "hashrate7d": "719G"}
{"diff": 2.42, "accepted": 32293362, "rejected": 15982, "bestshare": 0, "SPS1m": 0.0, "SPS5m": 0.0, "SPS15m": 0.0, "SPS1h": 0.0}

It is related to these lines in app/pages.tsx:

        <PoolStatsDisplay
          stats={latestStats}
          historicalStats={historicalStats}
        />

I think it might also be related to PoolStatsDisplay from components/PoolStatsDisplay.tsx .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions