Browse Source

Merge commit 'd3bfee1' into cg_merges_20121226

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
5e5adc12b8
2 changed files with 15 additions and 11 deletions
  1. 14 11
      miner.c
  2. 1 0
      miner.h

+ 14 - 11
miner.c

@@ -2150,11 +2150,11 @@ static void curses_print_status(void)
 		mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
 			have_longpoll ? "": "out");
 	} else if (pool->has_stratum) {
-		mvwprintw(statuswin, 4, 0, " Connected to %s with stratum as user %s",
-			pool->sockaddr_url, pool->rpc_user);
+		mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with stratum as user %s",
+			pool->sockaddr_url, pool->diff, pool->rpc_user);
 	} else {
-		mvwprintw(statuswin, 4, 0, " Connected to %s with%s LP as user %s",
-			pool->sockaddr_url, have_longpoll ? "": "out", pool->rpc_user);
+		mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with%s LP as user %s",
+			pool->sockaddr_url, pool->diff, have_longpoll ? "": "out", pool->rpc_user);
 	}
 	wclrtoeol(statuswin);
 	mvwprintw(statuswin, 5, 0, " Block: %s...  Diff:%s  Started: %s  Best share: %s   ",
@@ -2774,6 +2774,7 @@ static double DIFFEXACTONE = 269599466671506397946670150870196306736371444225405
 static void calc_diff(struct work *work, int known)
 {
 	struct cgminer_pool_stats *pool_stats = &(work->pool->cgminer_pool_stats);
+	double difficulty;
 
 	if (opt_scrypt) {
 		uint64_t *data64, d64;
@@ -2797,20 +2798,22 @@ static void calc_diff(struct work *work, int known)
 		work->work_difficulty = DIFFEXACTONE / (targ ? : DIFFEXACTONE);
 	} else
 		work->work_difficulty = known;
+	difficulty = work->work_difficulty;
 
-	pool_stats->last_diff = work->work_difficulty;
+	pool_stats->last_diff = difficulty;
+	suffix_string((uint64_t)difficulty, work->pool->diff, 0);
 
-	if (work->work_difficulty == pool_stats->min_diff)
+	if (difficulty == pool_stats->min_diff)
 		pool_stats->min_diff_count++;
-	else if (work->work_difficulty < pool_stats->min_diff || pool_stats->min_diff == 0) {
-		pool_stats->min_diff = work->work_difficulty;
+	else if (difficulty < pool_stats->min_diff || pool_stats->min_diff == 0) {
+		pool_stats->min_diff = difficulty;
 		pool_stats->min_diff_count = 1;
 	}
 
-	if (work->work_difficulty == pool_stats->max_diff)
+	if (difficulty == pool_stats->max_diff)
 		pool_stats->max_diff_count++;
-	else if (work->work_difficulty > pool_stats->max_diff) {
-		pool_stats->max_diff = work->work_difficulty;
+	else if (difficulty > pool_stats->max_diff) {
+		pool_stats->max_diff = difficulty;
 		pool_stats->max_diff_count = 1;
 	}
 }

+ 1 - 0
miner.h

@@ -919,6 +919,7 @@ struct pool {
 	int seq_getfails;
 	int solved;
 	int diff1;
+	char diff[8];
 
 	double diff_accepted;
 	double diff_rejected;