1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

fix bug which can occur when switching from a very low diff algo (darkcoin) to a high diff algo (scrypt), which caused invalid nonces

This commit is contained in:
Jan Berdajs 2014-05-28 00:37:53 +02:00
parent 5b8adcd9a1
commit cac833e5c2

View File

@ -6124,8 +6124,13 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work)
struct thr_info *thr = mining_thr[i];
thr->cgpu->algorithm = work->pool->algorithm;
thr->cgpu->drv->thread_prepare(thr);
// Necessary because algorithms can have dramatically different diffs
thr->cgpu->drv->working_diff = 1;
}
rd_unlock(&mining_thr_lock);
// Reset stats (e.g. for working_diff to be set properly in hash_sole_work)
zero_stats();
// Apply other pool-specific settings
// TODO: when config parser is improved, add else statements and set
// to default intensity