Allow unauthenticated mining
This commit is contained in:
parent
922ce0b92e
commit
fc5435e338
1 changed files with 5 additions and 12 deletions
17
cpu-miner.c
17
cpu-miner.c
|
@ -733,35 +733,30 @@ static void parse_arg (int key, char *arg)
|
||||||
v = atoi(arg);
|
v = atoi(arg);
|
||||||
if (v < -1 || v > 9999) /* sanity check */
|
if (v < -1 || v > 9999) /* sanity check */
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
opt_retries = v;
|
opt_retries = v;
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
v = atoi(arg);
|
v = atoi(arg);
|
||||||
if (v < 1 || v > 9999) /* sanity check */
|
if (v < 1 || v > 9999) /* sanity check */
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
opt_fail_pause = v;
|
opt_fail_pause = v;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
v = atoi(arg);
|
v = atoi(arg);
|
||||||
if (v < 1 || v > 9999) /* sanity check */
|
if (v < 1 || v > 9999) /* sanity check */
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
opt_scantime = v;
|
opt_scantime = v;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
v = atoi(arg);
|
v = atoi(arg);
|
||||||
if (v < 1 || v > 99999) /* sanity check */
|
if (v < 1 || v > 99999) /* sanity check */
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
opt_timeout = v;
|
opt_timeout = v;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
v = atoi(arg);
|
v = atoi(arg);
|
||||||
if (v < 1 || v > 9999) /* sanity check */
|
if (v < 1 || v > 9999) /* sanity check */
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
opt_n_threads = v;
|
opt_n_threads = v;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
|
@ -772,7 +767,6 @@ static void parse_arg (int key, char *arg)
|
||||||
if (strncmp(arg, "http://", 7) &&
|
if (strncmp(arg, "http://", 7) &&
|
||||||
strncmp(arg, "https://", 8))
|
strncmp(arg, "https://", 8))
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
free(rpc_url);
|
free(rpc_url);
|
||||||
rpc_url = strdup(arg);
|
rpc_url = strdup(arg);
|
||||||
p = strchr(rpc_url, '@');
|
p = strchr(rpc_url, '@');
|
||||||
|
@ -789,7 +783,6 @@ static void parse_arg (int key, char *arg)
|
||||||
case 'O': /* --userpass */
|
case 'O': /* --userpass */
|
||||||
if (!strchr(arg, ':'))
|
if (!strchr(arg, ':'))
|
||||||
show_usage_and_exit(1);
|
show_usage_and_exit(1);
|
||||||
|
|
||||||
free(rpc_userpass);
|
free(rpc_userpass);
|
||||||
rpc_userpass = strdup(arg);
|
rpc_userpass = strdup(arg);
|
||||||
break;
|
break;
|
||||||
|
@ -892,11 +885,11 @@ int main(int argc, char *argv[])
|
||||||
if (!opt_n_threads)
|
if (!opt_n_threads)
|
||||||
opt_n_threads = num_processors;
|
opt_n_threads = num_processors;
|
||||||
|
|
||||||
if (!rpc_userpass) {
|
if (!rpc_userpass && (rpc_user || rpc_pass)) {
|
||||||
if (!rpc_user || !rpc_pass) {
|
if (!rpc_user)
|
||||||
applog(LOG_ERR, "No login credentials supplied");
|
rpc_user = strdup("");
|
||||||
return 1;
|
if (!rpc_pass)
|
||||||
}
|
rpc_pass = strdup("");
|
||||||
rpc_userpass = malloc(strlen(rpc_user) + strlen(rpc_pass) + 2);
|
rpc_userpass = malloc(strlen(rpc_user) + strlen(rpc_pass) + 2);
|
||||||
if (!rpc_userpass)
|
if (!rpc_userpass)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue