- //printf ("Starting check thread ...\n");
- memset (&cargs, 0, sizeof (cargs));
-
- // set arguments
- cargs.next_fivehundred = next_fivehundred;
- cargs.total_num_nonces = total_num_nonces;
- cargs.total_added_nonces = total_added_nonces;
- cargs.idx = idx;
-
- pthread_create (&thread_check, NULL, check_thread, (void *)&cargs);
- thread_check_started = true;
+ if (total_added_nonces >= MIN_NONCES_REQUIRED)
+ {
+ num_good_first_bytes = estimate_second_byte_sum();
+ if (total_added_nonces > (NONCES_TRIGGER*idx) || num_good_first_bytes >= GOOD_BYTES_REQUIRED) {
+ pthread_create (&thread_check, NULL, check_thread, NULL);
+ thread_check_started = true;
+ idx++;
+ }
+ }