Display the current pool diff in the status line.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
diff --git a/cgminer.c b/cgminer.c
index 57fd79b..6e03e3f 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1933,11 +1933,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 %s as user %s",
- pool->sockaddr_url, have_longpoll ? "": "out",
+ mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with%s %s as user %s",
+ pool->sockaddr_url, pool->diff, have_longpoll ? "": "out",
pool->has_gbt ? "GBT" : "LP", pool->rpc_user);
}
wclrtoeol(statuswin);
@@ -2582,6 +2582,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;
@@ -2605,20 +2606,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;
}
}
diff --git a/miner.h b/miner.h
index b8a9124..f777a30 100644
--- a/miner.h
+++ b/miner.h
@@ -870,6 +870,7 @@ struct pool {
int seq_getfails;
int solved;
int diff1;
+ char diff[8];
double diff_accepted;
double diff_rejected;