-
Notifications
You must be signed in to change notification settings - Fork 100
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
Avoid SIGSEGV in tromp solver #556
Conversation
f7d6d25
to
7f89ac3
Compare
looks good |
break; | ||
} | ||
} | ||
check_tromp_solution(eq, validBlock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be here we need:
if (check_tromp_solution(eq, validBlock))
break;
To preserve the original logic? If we find a POW solution, do not try other solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I can tell, check_tromp_solution does not change the original logic:
the original logic breaks the loop if a solution is found
and check_tromp_solution in this case just returns also breaking solution searching.
It looks like the boolean return is needed for tests only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems you are right, sorry. The logic is fine.
p.s. It was "small display issue" (I mixed up the scopes somehow and what it breaks).
LGTM.
|
these changes implemented in combined PR: #559 |
Fixes #555
The tromp equihash solver can sometimes get in the state whereby the nsols counter is greater than MAXSOLS. An attempt is then made to read an element of the array beyond the array size (index out of bounds). This fix limits the reads to a maximum of MAXSOLS.
TODO: