Browse Source

Replace now-redundant accepted_weighed with equivalent diff_accepted

Luke Dashjr 13 years ago
parent
commit
02499eb1e6
2 changed files with 3 additions and 7 deletions
  1. 3 6
      miner.c
  2. 0 1
      miner.h

+ 3 - 6
miner.c

@@ -217,7 +217,6 @@ static struct list_head submit_waiting;
 
 int hw_errors;
 int total_accepted, total_rejected, total_diff1;
-float total_accepted_weighed;
 int total_getworks, total_stale, total_discarded;
 double total_diff_accepted, total_diff_rejected, total_diff_stale;
 static int total_queued, staged_rollable;
@@ -1955,7 +1954,7 @@ static void curses_print_devstatus(int thr_id)
 		return;
 
 	cgpu->utility = cgpu->accepted / total_secs * 60;
-	cgpu->utility_diff1 = cgpu->accepted_weighed / total_secs * 60;
+	cgpu->utility_diff1 = cgpu->diff_accepted / total_secs * 60;
 
 	if (wmove(statuswin, ypos, 0) == ERR)
 		return;
@@ -2319,9 +2318,7 @@ static bool submit_upstream_work(const struct work *work, CURL *curl, bool resub
 	 * same time is zero so there is no point adding extra locking */
 	if (json_is_null(res) || json_is_true(res)) {
 		cgpu->accepted++;
-		cgpu->accepted_weighed += work->work_difficulty;
 		total_accepted++;
-		total_accepted_weighed += work->work_difficulty;
 		pool->accepted++;
 		cgpu->diff_accepted += work->work_difficulty;
 		total_diff_accepted += work->work_difficulty;
@@ -2418,7 +2415,7 @@ static bool submit_upstream_work(const struct work *work, CURL *curl, bool resub
 	}
 
 	cgpu->utility = cgpu->accepted / total_secs * 60;
-	cgpu->utility_diff1 = cgpu->accepted_weighed / total_secs * 60;
+	cgpu->utility_diff1 = cgpu->diff_accepted / total_secs * 60;
 
 	if (!opt_realquiet)
 		print_status(thr_id);
@@ -4750,7 +4747,7 @@ static void hashmeter(int thr_id, struct timeval *diff,
 		(char*[]){cHr, aHr, uHr},
 		1e6*rolling,
 		1e6*total_mhashes_done / total_secs,
-		utility_to_hashrate(total_accepted_weighed / (total_secs ?: 1) * 60),
+		utility_to_hashrate(total_diff_accepted / (total_secs ?: 1) * 60),
 		H2B_SPACED);
 	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d  R:%d  HW:%d  E:%.0f%%  U:%.1f/m",
 		want_per_device_stats ? "ALL " : "",

+ 0 - 1
miner.h

@@ -396,7 +396,6 @@ struct cgpu_info {
 
 	enum dev_enable deven;
 	int accepted;
-	double accepted_weighed;
 	int rejected;
 	int hw_errors;
 	double rolling;