Browse Source

Merge commit '577f1a2' into cg_merges_20131108a

Conflicts:
	driver-klondike.c
Luke Dashjr 12 years ago
parent
commit
b6428d2f18
1 changed files with 8 additions and 1 deletions
  1. 8 1
      driver-klondike.c

+ 8 - 1
driver-klondike.c

@@ -108,6 +108,8 @@ struct klondike_info {
 	WORKCFG *cfg;
 	char *replies;
 	int nextreply;
+	int noncecount;
+	uint64_t hashcount;
 	
 	pthread_mutex_t devlock;
 	struct libusb_device_handle *usbdev_handle;
@@ -411,6 +413,7 @@ static void klondike_check_nonce(struct cgpu_info *klncgpu, WORKRESULT *result)
 			
 			wr_lock(&(klninfo->stat_lock));
 			klninfo->devinfo[result->device].noncecount++;
+			klninfo->noncecount++;
 			wr_unlock(&(klninfo->stat_lock));
 			
 			result->nonce = le32toh(result->nonce - 0xC0);
@@ -615,7 +618,8 @@ static int64_t klondike_scanwork(struct thr_info *thr)
 				newhashdev += klninfo->status[dev].maxcount; // hash counter wrapped
 			newhashdev += klninfo->status[dev].hashcount - klninfo->devinfo[dev].lasthashcount;
 			klninfo->devinfo[dev].lasthashcount = klninfo->status[dev].hashcount;
-			newhashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
+			klninfo->hashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
+			newhashcount += 0xffffffffull * (uint64_t)klninfo->noncecount;
 			
 			// todo: check stats for critical conditions
 		}
@@ -694,6 +698,9 @@ static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)
 			root = api_add_string(root, buf, data, true);
 		}
 	}
+
+	root = api_add_uint64(root, "Hash Count", &(klninfo->hashcount), true);
+
 	rd_unlock(&(klninfo->stat_lock));
 	
 	return root;