Browse Source

Merge commit '0f36918' into HEAD

Luke Dashjr 13 years ago
parent
commit
593ef9c5eb
2 changed files with 6 additions and 17 deletions
  1. 4 17
      miner.c
  2. 2 0
      util.c

+ 4 - 17
miner.c

@@ -5415,6 +5415,8 @@ out:
 static void shutdown_stratum(struct pool *pool)
 {
 	// Shut down Stratum as if we never had it
+	pool->stratum_active = false;
+	pool->stratum_auth = false;
 	pool->has_stratum = false;
 	shutdown(pool->sock, SHUT_RDWR);
 	free(pool->stratum_url);
@@ -5539,22 +5541,9 @@ static void *stratum_thread(void *userdata)
 			if (initiate_stratum(pool) && auth_stratum(pool))
 				continue;
 
-			if (pool->rpc_url[0] != 's') {
-				shutdown_stratum(pool);
-				pool_active(pool, false);
-				break;
-			}
-
+			shutdown_stratum(pool);
 			pool_died(pool);
-			while (!initiate_stratum(pool) || !auth_stratum(pool)) {
-				if (pool->removed)
-					goto out;
-				sleep(30);
-			}
-			applog(LOG_INFO, "Stratum connection to pool %d resumed", pool->pool_no);
-			pool_tclear(pool, &pool->idle);
-			pool_resus(pool);
-			continue;
+			break;
 		}
 
 		if (!parse_method(pool, s) && !parse_stratum_response(pool, s))
@@ -5705,8 +5694,6 @@ retry_stratum:
 			return false;
 		if (!auth_stratum(pool))
 			return false;
-		pool->idle = false;
-		pool->stratum_auth = true;
 		init_stratum_thread(pool);
 		detect_algo = 2;
 		return true;

+ 2 - 0
util.c

@@ -1282,6 +1282,7 @@ bool auth_stratum(struct pool *pool)
 	}
 	ret = true;
 	applog(LOG_INFO, "Stratum authorisation success for pool %d", pool->pool_no);
+	pool->stratum_auth = true;
 out:
 	if (val)
 		json_decref(val);
@@ -1300,6 +1301,7 @@ bool initiate_stratum(struct pool *pool)
 
 	mutex_lock(&pool->stratum_lock);
 	pool->stratum_active = false;
+	pool->stratum_auth = false;
 	if (!pool->stratum_curl) {
 		pool->stratum_curl = curl_easy_init();
 		if (unlikely(!pool->stratum_curl))