Browse Source

algo aliases, fix max-diff param without pool config

master
Tanguy Pruvot 10 years ago
parent
commit
f1a55b3388
  1. 22
      ccminer.cpp

22
ccminer.cpp

@ -256,8 +256,8 @@ uint64_t net_blocks = 0;
// conditional mining // conditional mining
uint8_t conditional_state[MAX_GPUS] = { 0 }; uint8_t conditional_state[MAX_GPUS] = { 0 };
double opt_max_temp = 0.0; double opt_max_temp = 0.0;
double opt_max_diff = 0.0; double opt_max_diff = -1.;
double opt_max_rate = 0.0; double opt_max_rate = -1.;
int opt_statsavg = 30; int opt_statsavg = 30;
// strdup on char* to allow a common free() if used // strdup on char* to allow a common free() if used
@ -2447,8 +2447,11 @@ bool pool_switch(int pooln)
opt_scantime = p->scantime; opt_scantime = p->scantime;
opt_max_diff = p->max_diff; if (p->max_diff > -1.)
opt_max_rate = p->max_rate; opt_max_diff = p->max_diff;
if (p->max_rate > -1.)
opt_max_rate = p->max_rate;
opt_time_limit = p->time_limit; opt_time_limit = p->time_limit;
want_stratum = have_stratum = (p->type & POOL_STRATUM) != 0; want_stratum = have_stratum = (p->type & POOL_STRATUM) != 0;
@ -2591,7 +2594,7 @@ void parse_arg(int key, char *arg)
double d; double d;
switch(key) { switch(key) {
case 'a': case 'a': /* --algo */
p = strstr(arg, ":"); // optional factor p = strstr(arg, ":"); // optional factor
if (p) *p = '\0'; if (p) *p = '\0';
for (i = 0; i < ARRAY_SIZE(algo_names); i++) { for (i = 0; i < ARRAY_SIZE(algo_names); i++) {
@ -2600,6 +2603,15 @@ void parse_arg(int key, char *arg)
break; break;
} }
} }
if (i == ARRAY_SIZE(algo_names)) {
// some aliases...
if (!strcasecmp("diamond", arg))
i = opt_algo = ALGO_DMD_GR;
else if (!strcasecmp("ziftr", arg))
i = opt_algo = ALGO_ZR5;
else
applog(LOG_ERR, "Unknown algo parameter '%s'", arg);
}
if (i == ARRAY_SIZE(algo_names)) if (i == ARRAY_SIZE(algo_names))
show_usage_and_exit(1); show_usage_and_exit(1);
if (p) { if (p) {

Loading…
Cancel
Save