Commit 44f5d55d5109b40c084634f567e4deb096f6140a

Con Kolivas 2012-06-14T17:16:37

Iterate over each thread belonging to each device in the hashmeter instead of searching for them now that they're a list.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/cgminer.c b/cgminer.c
index 6bbf1eb..40c96da 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3302,12 +3302,9 @@ static void hashmeter(int thr_id, struct timeval *diff,
 
 		/* Rolling average for each thread and each device */
 		decay_time(&thr->rolling, local_mhashes / secs);
-		for (i = 0; i < mining_threads; i++) {
-			struct thr_info *th = &thr_info[i];
+		for (i = 0; i < cgpu->threads; i++)
+			thread_rolling += cgpu->thr[i]->rolling;
 
-			if (th->cgpu == cgpu)
-				thread_rolling += th->rolling;
-		}
 		mutex_lock(&hash_lock);
 		decay_time(&cgpu->rolling, thread_rolling);
 		cgpu->total_mhashes += local_mhashes;