mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-08 21:14:14 +00:00
Allow disable extranonce subscribe
This commit is contained in:
parent
b742ced4eb
commit
4ad62b9a78
1
miner.h
1
miner.h
@ -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];
|
||||
|
@ -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[] = {
|
||||
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)
|
||||
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:
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user