Commit c7ce722eeba5c03d8cf6e9ae921d2a2f2f563def

Con Kolivas 2014-01-25T16:40:49

Only count 2/3 of the accumulated hashes on each pass through the hfa scan work loop to smooth out displayed hashrate.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 15cc4d1..ac66b2d 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -995,10 +995,12 @@ restart:
 		       hashfast->device_id, info->hash_sequence_head, op_hash_data.search_difficulty, work->work_difficulty);
 	}
 
+	/* Only count 2/3 of the hashes to smooth out the hashrate for cycles
+	 * that have no hashes added. */
 	mutex_lock(&info->lock);
-	hashes = info->hash_count;
+	hashes = info->hash_count / 3 * 2;
 	info->calc_hashes += hashes;
-	info->hash_count = 0;
+	info->hash_count -= hashes;
 	mutex_unlock(&info->lock);
 
 	return hashes;