Skip to content

index out of bounds when specifying -E <anything not from the end of the list of GPUs> #27

Description

@worrells-best

hashRateReports is an array with its length equal to the number of GPUs being used, but it is accessed by the miner ID, which will be problematic when certain GPUs are excluded (any not from the end of the list of GPUs).

Take for example a system with two GPUs: 0 and 1. If -E 0 is specified, hashRateReports will be initialized as a list with one element. The only active GPU has a minerID of 1. hashRateReports[1] will be accessed, causing an index out of bounds error.

An easy fix is to change
hashRateReports := make([]float64, nrOfMiningDevices)
to
hashRateReports := make(map[int]float64)

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions