Commit 874b25f979ed2d217010c5f1c0eb8865f7893d00

Xiangfu 2013-04-10T14:10:40

avalon: if result_wrong >= get_work_count jump out the read loop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/driver-avalon.c b/driver-avalon.c
index b1d3fb3..7584c9a 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -908,6 +908,9 @@ static int64_t avalon_scanhash(struct thr_info *thr)
 			info->no_matching_work++;
 			result_wrong++;
 
+			if (result_wrong >= avalon_get_work_count)
+				break;
+
 			if (opt_debug) {
 				timersub(&tv_finish, &tv_start, &elapsed);
 				applog(LOG_DEBUG,"Avalon: no matching work: %d"