Commit e414cd055cc5e9609f94f815102cec63c16a828b

Con Kolivas 2013-02-16T09:07:33

Fix tv_lastupdate being made into tv_end and update the hashmeter on cycle, not opt_log_interval.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index ff7b3eb..2e427da 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5565,10 +5565,10 @@ static void hash_sole_work(struct thr_info *mythr)
 				max_nonce = max_nonce * 0x400 / (((cycle * 1000000) + sdiff.tv_usec) / (cycle * 1000000 / 0x400));
 
 			timersub(&tv_end, &tv_lastupdate, &diff);
-			if (diff.tv_sec >= opt_log_interval) {
+			if (diff.tv_sec >= cycle) {
 				hashmeter(thr_id, &diff, hashes_done);
 				hashes_done = 0;
-				tv_lastupdate = tv_end;
+				memcpy(&tv_lastupdate, &tv_end, sizeof(struct timeval));
 			}
 
 			if (unlikely(mythr->work_restart)) {