Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
worrells-best opened this issue Jul 1, 2017 · 1 comment

Comments

@worrells-best
Copy link

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)

@robvanmieghem
Copy link
Owner

robvanmieghem commented Jan 14, 2018

@eperm thank you for reporting the issue and the proposed solution. I've been in the hospital for half a year but am back now.

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

No branches or pull requests

2 participants