Browse Source

Merge pull request #193 from troky/master

Small fix and upgrade
refactor
Noel Maersk 11 years ago
parent
commit
e731aa1f16
  1. 1
      api.c
  2. 4
      sgminer.c

1
api.c

@ -1820,6 +1820,7 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
root = api_add_int(root, "POOL", &i, false); root = api_add_int(root, "POOL", &i, false);
root = api_add_string(root, "Name", pool->name, false); root = api_add_string(root, "Name", pool->name, false);
root = api_add_escape(root, "URL", pool->rpc_url, false); root = api_add_escape(root, "URL", pool->rpc_url, false);
root = api_add_string(root, "Algorithm", pool->algorithm.name, false);
root = api_add_string(root, "Description", pool->description, false); root = api_add_string(root, "Description", pool->description, false);
root = api_add_string(root, "Status", status, false); root = api_add_string(root, "Status", status, false);
root = api_add_int(root, "Priority", &(pool->prio), false); root = api_add_int(root, "Priority", &(pool->prio), false);

4
sgminer.c

@ -1063,7 +1063,7 @@ static void load_temp_cutoffs()
static char *set_algo(const char *arg) static char *set_algo(const char *arg)
{ {
if (json_array_index < 0) { if ((json_array_index < 0) || (total_pools == 0)) {
set_algorithm(opt_algorithm, arg); set_algorithm(opt_algorithm, arg);
applog(LOG_INFO, "Set default algorithm to %s", opt_algorithm->name); applog(LOG_INFO, "Set default algorithm to %s", opt_algorithm->name);
} else { } else {
@ -1075,7 +1075,7 @@ static char *set_algo(const char *arg)
static char *set_nfactor(const char *arg) static char *set_nfactor(const char *arg)
{ {
if (json_array_index < 0) { if ((json_array_index < 0) || (total_pools == 0)) {
set_algorithm_nfactor(opt_algorithm, (const uint8_t) atoi(arg)); set_algorithm_nfactor(opt_algorithm, (const uint8_t) atoi(arg));
applog(LOG_INFO, "Set algorithm N-factor to %d (N to %d)", applog(LOG_INFO, "Set algorithm N-factor to %d (N to %d)",
opt_algorithm->nfactor, opt_algorithm->n); opt_algorithm->nfactor, opt_algorithm->n);

Loading…
Cancel
Save