mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Display the current pool diff in the status line.
This commit is contained in:
parent
fedf0f11e4
commit
d3bfee14b3
25
cgminer.c
25
cgminer.c
@ -1933,11 +1933,11 @@ static void curses_print_status(void)
|
|||||||
mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
|
mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
|
||||||
have_longpoll ? "": "out");
|
have_longpoll ? "": "out");
|
||||||
} else if (pool->has_stratum) {
|
} else if (pool->has_stratum) {
|
||||||
mvwprintw(statuswin, 4, 0, " Connected to %s with stratum as user %s",
|
mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with stratum as user %s",
|
||||||
pool->sockaddr_url, pool->rpc_user);
|
pool->sockaddr_url, pool->diff, pool->rpc_user);
|
||||||
} else {
|
} else {
|
||||||
mvwprintw(statuswin, 4, 0, " Connected to %s with%s %s as user %s",
|
mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with%s %s as user %s",
|
||||||
pool->sockaddr_url, have_longpoll ? "": "out",
|
pool->sockaddr_url, pool->diff, have_longpoll ? "": "out",
|
||||||
pool->has_gbt ? "GBT" : "LP", pool->rpc_user);
|
pool->has_gbt ? "GBT" : "LP", pool->rpc_user);
|
||||||
}
|
}
|
||||||
wclrtoeol(statuswin);
|
wclrtoeol(statuswin);
|
||||||
@ -2582,6 +2582,7 @@ static double DIFFEXACTONE = 269599466671506397946670150870196306736371444225405
|
|||||||
static void calc_diff(struct work *work, int known)
|
static void calc_diff(struct work *work, int known)
|
||||||
{
|
{
|
||||||
struct cgminer_pool_stats *pool_stats = &(work->pool->cgminer_pool_stats);
|
struct cgminer_pool_stats *pool_stats = &(work->pool->cgminer_pool_stats);
|
||||||
|
double difficulty;
|
||||||
|
|
||||||
if (opt_scrypt) {
|
if (opt_scrypt) {
|
||||||
uint64_t *data64, d64;
|
uint64_t *data64, d64;
|
||||||
@ -2605,20 +2606,22 @@ static void calc_diff(struct work *work, int known)
|
|||||||
work->work_difficulty = DIFFEXACTONE / (targ ? : DIFFEXACTONE);
|
work->work_difficulty = DIFFEXACTONE / (targ ? : DIFFEXACTONE);
|
||||||
} else
|
} else
|
||||||
work->work_difficulty = known;
|
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++;
|
pool_stats->min_diff_count++;
|
||||||
else if (work->work_difficulty < pool_stats->min_diff || pool_stats->min_diff == 0) {
|
else if (difficulty < pool_stats->min_diff || pool_stats->min_diff == 0) {
|
||||||
pool_stats->min_diff = work->work_difficulty;
|
pool_stats->min_diff = difficulty;
|
||||||
pool_stats->min_diff_count = 1;
|
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++;
|
pool_stats->max_diff_count++;
|
||||||
else if (work->work_difficulty > pool_stats->max_diff) {
|
else if (difficulty > pool_stats->max_diff) {
|
||||||
pool_stats->max_diff = work->work_difficulty;
|
pool_stats->max_diff = difficulty;
|
||||||
pool_stats->max_diff_count = 1;
|
pool_stats->max_diff_count = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user