Commit 97a917237035e255c968ae312b2252af597241f1

Con Kolivas 2013-04-05T11:01:20

Update the total_tv_end only when we show the log to prevent failure to update logs.

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 d9481c0..b1a95e5 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4697,9 +4697,10 @@ static void hashmeter(int thr_id, struct timeval *diff,
 	if (total_diff.tv_sec < opt_log_interval) {
 		if (thr_id < 0)
 			goto out_unlock;
-	} else
+	} else {
 		showlog = true;
-	gettimeofday(&total_tv_end, NULL);
+		gettimeofday(&total_tv_end, NULL);
+	}
 
 	local_secs = (double)total_diff.tv_sec + ((double)total_diff.tv_usec / 1000000.0);
 	decay_time(&rolling, local_mhashes_done / local_secs);