Browse Source

Allow disable extranonce subscribe

idlebug
elbandi 11 years ago committed by Elbandi
parent
commit
4ad62b9a78
  1. 1
      miner.h
  2. 8
      sgminer.c
  3. 2
      util.c

1
miner.h

@ -1078,6 +1078,7 @@ extern int nDevs; @@ -1078,6 +1078,7 @@ extern int nDevs;
extern int hw_errors;
extern bool use_syslog;
extern bool opt_quiet;
extern bool opt_extranonce_subscribe;
extern struct thr_info *control_thr;
extern struct thr_info **mining_thr;
extern struct cgpu_info gpus[MAX_GPUDEVICES];

8
sgminer.c

@ -151,6 +151,7 @@ bool opt_api_network; @@ -151,6 +151,7 @@ bool opt_api_network;
bool opt_delaynet;
bool opt_disable_pool;
bool opt_disable_client_reconnect = false;
bool opt_extranonce_subscribe = true;
static bool no_work;
bool opt_worktime;
#if defined(HAVE_LIBCURL) && defined(CURL_HAS_KEEPALIVE)
@ -1327,6 +1328,9 @@ static struct opt_table opt_config_table[] = { @@ -1327,6 +1328,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--no-submit-stale",
opt_set_invbool, &opt_submit_stale,
"Don't submit shares if they are detected as stale"),
OPT_WITHOUT_ARG("--no-extranonce-subscribe",
opt_set_invbool, &opt_extranonce_subscribe,
"Disable 'extranonce' stratum subscribe"),
OPT_WITH_ARG("--pass|-p",
set_pass, NULL, NULL,
"Password for bitcoin JSON-RPC server"),
@ -5207,7 +5211,7 @@ static bool parse_stratum_response(struct pool *pool, char *s) @@ -5207,7 +5211,7 @@ static bool parse_stratum_response(struct pool *pool, char *s)
if (err_val && !json_is_null(err_val)) {
char *ss;
ss = (char *)json_string_value(json_array_get(err_val, 1));
if (strcmp(ss, "Method 'subscribe' not found for service 'mining.extranonce'") == 0) {
if (opt_extranonce_subscribe && strcmp(ss, "Method 'subscribe' not found for service 'mining.extranonce'") == 0) {
applog(LOG_INFO, "Cannot subscribe to mining.extranonce on %s", get_pool_name(pool));
goto out;
}
@ -5682,7 +5686,7 @@ retry_stratum: @@ -5682,7 +5686,7 @@ retry_stratum:
bool init = pool_tset(pool, &pool->stratum_init);
if (!init) {
bool ret = initiate_stratum(pool) && auth_stratum(pool) && subscribe_extranonce(pool);
bool ret = initiate_stratum(pool) && auth_stratum(pool) && (!opt_extranonce_subscribe || subscribe_extranonce(pool));
if (ret)
init_stratum_threads(pool);

2
util.c

@ -2522,7 +2522,7 @@ bool restart_stratum(struct pool *pool) @@ -2522,7 +2522,7 @@ bool restart_stratum(struct pool *pool)
return false;
if (!auth_stratum(pool))
return false;
if (!subscribe_extranonce(pool))
if (opt_extranonce_subscribe && !subscribe_extranonce(pool))
return false;
return true;

Loading…
Cancel
Save