Skip to content

Commit

Permalink
Show pool name/pool url
Browse files Browse the repository at this point in the history
  • Loading branch information
lasybear committed Jun 1, 2014
1 parent a7d11b1 commit 4de8bd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@ struct stratum_work {
struct pool {
int pool_no;
char *poolname;
bool haspoolname;
int prio;
int accepted, rejected;
int seq_rejects;
Expand Down
14 changes: 10 additions & 4 deletions sgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ struct pool *add_pool(void)
sprintf(buf, "Pool %d", pool->pool_no);

pool->poolname = strdup(buf);
pool->haspoolname = false;

pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
pools[total_pools++] = pool;
Expand Down Expand Up @@ -781,6 +782,8 @@ static char *set_poolname(char *arg)
applog(LOG_DEBUG, "Setting pool %i name to %s", pool->pool_no, arg);
opt_set_charp(arg, &pool->poolname);

pool->haspoolname = true;

return NULL;
}

Expand Down Expand Up @@ -2249,7 +2252,7 @@ static void curses_print_status(void)
have_longpoll ? "with": "without");
} else {
cg_mvwprintw(statuswin, 4, 0, "Connected to %s (%s) diff %s as user %s",
pool->poolname,
pool->haspoolname ? pool->poolname : (pool->has_stratum ? pool->rpc_url+14 : pool->rpc_url+7),
pool->has_stratum ? "stratum" : (pool->has_gbt ? "GBT" : "longpoll"),
pool->diff, pool->rpc_user);
}
Expand Down Expand Up @@ -4643,13 +4646,16 @@ static void display_pools(void)
disp_name = pool->poolname;
if (strlen(disp_name) < 1)
{
disp_name = pool->rpc_url;
disp_name = "noname";
}
wlogprint("%s Quota %d Prio %d: '%s' User:%s\n",

wlogprint("%s Quota %d Prio %d: '%s' %s User:%s\n",
pool->idle ? "Dead" : "Alive",
pool->quota,
pool->prio,
disp_name, pool->rpc_user);
disp_name,
pool->rpc_url,
pool->rpc_user);
wattroff(logwin, A_BOLD | A_DIM);
}
retry:
Expand Down

0 comments on commit 4de8bd0

Please sign in to comment.