Browse Source

Some tweaks for extranonce

idlebug
elbandi 11 years ago
parent
commit
e7bca31941
  1. 9
      sgminer.c
  2. 6
      util.c

9
sgminer.c

@ -5208,15 +5208,6 @@ static bool parse_stratum_response(struct pool *pool, char *s)
id = json_integer_value(id_val); id = json_integer_value(id_val);
if (err_val && !json_is_null(err_val)) {
char *ss;
ss = (char *)json_string_value(json_array_get(err_val, 1));
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;
}
}
mutex_lock(&sshare_lock); mutex_lock(&sshare_lock);
HASH_FIND_INT(stratum_shares, &id, sshare); HASH_FIND_INT(stratum_shares, &id, sshare);
if (sshare) { if (sshare) {

6
util.c

@ -1671,12 +1671,10 @@ static bool parse_extranonce(struct pool *pool, json_t *val)
nonce1 = json_array_string(val, 0); nonce1 = json_array_string(val, 0);
if (!nonce1) { if (!nonce1) {
// applog(LOG_INFO, "Failed to get nonce1 in ");
return false; return false;
} }
n2size = json_integer_value(json_array_get(val, 1)); n2size = json_integer_value(json_array_get(val, 1));
if (!n2size) { if (!n2size) {
// applog(LOG_INFO, "Failed to get n2size in ");
free(nonce1); free(nonce1);
return false; return false;
} }
@ -1692,7 +1690,7 @@ static bool parse_extranonce(struct pool *pool, json_t *val)
pool->n2size = n2size; pool->n2size = n2size;
cg_wunlock(&pool->data_lock); cg_wunlock(&pool->data_lock);
applog(LOG_NOTICE, "%s coin change requested", get_pool_name(pool)); applog(LOG_NOTICE, "%s extranonce change requested", get_pool_name(pool));
return true; return true;
} }
@ -1880,7 +1878,7 @@ bool subscribe_extranonce(struct pool *pool)
if (!stratum_send(pool, s, strlen(s))) if (!stratum_send(pool, s, strlen(s)))
return ret; return ret;
/* Parse all data in the queue and anything left should be auth */ /* Parse all data in the queue and anything left should be the response */
while (42) { while (42) {
if (!socket_full(pool, DEFAULT_SOCKWAIT / 30)) { if (!socket_full(pool, DEFAULT_SOCKWAIT / 30)) {
applog(LOG_DEBUG, "Timed out waiting for response extranonce.subscribe"); applog(LOG_DEBUG, "Timed out waiting for response extranonce.subscribe");

Loading…
Cancel
Save