Commit 9b1ac1796f6d4d26ee732df325b3edbad7220999

Kano 2013-09-22T23:41:06

klondike add new nonecount only once

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-klondike.c b/driver-klondike.c
index 7ee8e1a..b11c21d 100644
--- a/driver-klondike.c
+++ b/driver-klondike.c
@@ -519,10 +519,11 @@ static int64_t klondike_scanwork(struct thr_info *thr)
 			newhashdev += klninfo->status[dev].hashcount - klninfo->devinfo[dev].lasthashcount;
 			klninfo->devinfo[dev].lasthashcount = klninfo->status[dev].hashcount;
 			klninfo->hashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
-			newhashcount += 0xffffffffull * (uint64_t)klninfo->noncecount;
 			
 			// todo: check stats for critical conditions
 		}
+		newhashcount += 0xffffffffull * (uint64_t)klninfo->noncecount;
+		klninfo->noncecount = 0;
 		rd_unlock(&(klninfo->stat_lock));
 	}
 	return newhashcount;