Fixed a bug in the end condition for threads

This commit is contained in:
Aram
2016-05-11 20:46:34 +02:00
parent 7a0ec5e052
commit 6d274c1a73
4 changed files with 32 additions and 0 deletions

View File

@ -660,6 +660,14 @@ int main (int argc, const char * argv[]) {
space = craptev1_get_space(nonces, 95, uid);
}
if(space){
// append some zeroes to the end of the space to make sure threads don't go off into the wild
size_t j = 0;
for(j = 0; space[j]; j+=5){
}
size_t fill = j + (5*thread_count);
for(; j < fill; j++) {
space[j] = 0;
}
total_states = craptev1_sizeof_space(space);
} else {
total_states = 0;