fix: #520 - free mutex after work is done
Why not just free after key found or not found?
This commit is contained in:
@@ -1845,14 +1845,15 @@ static bool TestIfKeyExists(uint64_t key) {
|
|||||||
num_keys_tested += count;
|
num_keys_tested += count;
|
||||||
hardnested_print_progress(num_acquired_nonces, "(Test: Key found)", 0.0, 0);
|
hardnested_print_progress(num_acquired_nonces, "(Test: Key found)", 0.0, 0);
|
||||||
crypto1_destroy(pcs);
|
crypto1_destroy(pcs);
|
||||||
|
pthread_mutex_destroy(&statelist_cache_mutex);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
num_keys_tested += count;
|
num_keys_tested += count;
|
||||||
hardnested_print_progress(num_acquired_nonces, "(Test: Key NOT found)", 0.0, 0);
|
hardnested_print_progress(num_acquired_nonces, "(Test: Key NOT found)", 0.0, 0);
|
||||||
|
|
||||||
crypto1_destroy(pcs);
|
crypto1_destroy(pcs);
|
||||||
|
pthread_mutex_destroy(&statelist_cache_mutex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2042,9 +2043,6 @@ static void generate_candidates(uint8_t sum_a0_idx, uint8_t sum_a8_idx) {
|
|||||||
pthread_join(thread_id[i], NULL);
|
pthread_join(thread_id[i], NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up mutex
|
|
||||||
pthread_mutex_destroy(&statelist_cache_mutex);
|
|
||||||
|
|
||||||
maximum_states = 0;
|
maximum_states = 0;
|
||||||
for (statelist_t *sl = candidates; sl != NULL; sl = sl->next) {
|
for (statelist_t *sl = candidates; sl != NULL; sl = sl->next) {
|
||||||
maximum_states += (uint64_t)sl->len[ODD_STATE] * sl->len[EVEN_STATE];
|
maximum_states += (uint64_t)sl->len[ODD_STATE] * sl->len[EVEN_STATE];
|
||||||
|
|||||||
Reference in New Issue
Block a user