This commit is contained in:
Jay D Dee
2019-08-03 10:39:54 -04:00
parent 9d49e0be7a
commit a042fb7612
16 changed files with 173 additions and 83 deletions

View File

@@ -102,7 +102,9 @@ int opt_timeout = 300;
static int opt_scantime = 5;
//static const bool opt_time = true;
enum algos opt_algo = ALGO_NULL;
int opt_scrypt_n = 0;
char* opt_param_key = NULL;
int opt_param_n = 0;
int opt_param_r = 0;
int opt_pluck_n = 128;
int opt_n_threads = 0;
// Windows doesn't support 128 bit affinity mask.
@@ -176,7 +178,7 @@ static char const short_options[] =
#ifdef HAVE_SYSLOG_H
"S"
#endif
"a:b:Bc:CDf:hm:n:p:Px:qr:R:s:t:T:o:u:O:V";
"a:b:Bc:CDf:hK:m:n:N:p:Px:qr:R:s:t:T:o:u:O:V";
static struct work g_work __attribute__ ((aligned (64))) = {{ 0 }};
//static struct work tmp_work;
@@ -2857,10 +2859,10 @@ void parse_arg(int key, char *arg )
{
char *ep;
v = strtol(arg+v+1, &ep, 10);
if (*ep || v < 2)
if (*ep || v < 2)
continue;
opt_algo = (enum algos) i;
opt_scrypt_n = v;
opt_param_n = v;
break;
}
}
@@ -2943,8 +2945,10 @@ void parse_arg(int key, char *arg )
show_usage_and_exit(1);
opt_retries = v;
break;
case 'R':
v = atoi(arg);
// case 'R':
// applog(LOG_WARNING,"\n-R is no longer valid, use --retry-pause instead.");
case 1025:
v = atoi(arg);
if (v < 1 || v > 9999) /* sanity check */
show_usage_and_exit(1);
opt_fail_pause = v;
@@ -3153,7 +3157,19 @@ void parse_arg(int key, char *arg )
show_usage_and_exit(1);
opt_priority = v;
break;
case 1060: // max-temp
case 'N': // N parameter for various scrypt algos
d = atoi( arg );
opt_param_n = d;
break;
case 'R': // R parameter for various scrypt algos
d = atoi( arg );
opt_param_r = d;
break;
case 'K': // Client key for various algos
free( opt_param_key );
opt_param_key = strdup( arg );
break;
case 1060: // max-temp
d = atof(arg);
opt_max_temp = d;
break;
@@ -3178,7 +3194,8 @@ void parse_arg(int key, char *arg )
show_version_and_exit();
case 'h':
show_usage_and_exit(0);
default:
default:
show_usage_and_exit(1);
}
}