Browse Source

Replace now-redundant accepted_weighed with equivalent diff_accepted

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

+ 3 - 6
miner.c

@@ -232,7 +232,6 @@ static struct list_head submit_waiting;
 
 
 int hw_errors;
 int hw_errors;
 int total_accepted, total_rejected, total_diff1;
 int total_accepted, total_rejected, total_diff1;
-float total_accepted_weighed;
 int total_getworks, total_stale, total_discarded;
 int total_getworks, total_stale, total_discarded;
 double total_diff_accepted, total_diff_rejected, total_diff_stale;
 double total_diff_accepted, total_diff_rejected, total_diff_stale;
 static int total_queued, staged_rollable;
 static int total_queued, staged_rollable;
@@ -2113,7 +2112,7 @@ static void curses_print_devstatus(int thr_id)
 		return;
 		return;
 
 
 	cgpu->utility = cgpu->accepted / total_secs * 60;
 	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)
 	if (wmove(statuswin, ypos, 0) == ERR)
 		return;
 		return;
@@ -2374,9 +2373,7 @@ share_result(json_t *val, json_t *res, json_t *err, const struct work *work,
 
 
 	if (json_is_null(res) || json_is_true(res)) {
 	if (json_is_null(res) || json_is_true(res)) {
 		cgpu->accepted++;
 		cgpu->accepted++;
-		cgpu->accepted_weighed += work->work_difficulty;
 		total_accepted++;
 		total_accepted++;
-		total_accepted_weighed += work->work_difficulty;
 		pool->accepted++;
 		pool->accepted++;
 		cgpu->diff_accepted += work->work_difficulty;
 		cgpu->diff_accepted += work->work_difficulty;
 		total_diff_accepted += work->work_difficulty;
 		total_diff_accepted += work->work_difficulty;
@@ -2646,7 +2643,7 @@ static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)
 	share_result(val, res, err, work, hashshow, resubmit, worktime);
 	share_result(val, res, err, work, hashshow, resubmit, worktime);
 
 
 	cgpu->utility = cgpu->accepted / total_secs * 60;
 	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)
 	if (!opt_realquiet)
 		print_status(thr_id);
 		print_status(thr_id);
@@ -5215,7 +5212,7 @@ static void hashmeter(int thr_id, struct timeval *diff,
 		(char*[]){cHr, aHr, uHr},
 		(char*[]){cHr, aHr, uHr},
 		1e6*rolling,
 		1e6*rolling,
 		1e6*total_mhashes_done / total_secs,
 		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);
 		H2B_SPACED);
 
 
 	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d  R:%d  HW:%d  E:%.0f%%  U:%.1f/m",
 	sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d  R:%d  HW:%d  E:%.0f%%  U:%.1f/m",

+ 0 - 1
miner.h

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