Browse Source

Merge commit '0f36918' into bfgminer

Conflicts:
	miner.c
	util.c
Luke Dashjr 13 years ago
parent
commit
16dc8a8781
2 changed files with 6 additions and 17 deletions
  1. 4 17
      miner.c
  2. 2 0
      util.c

+ 4 - 17
miner.c

@@ -5426,6 +5426,8 @@ out:
 static void shutdown_stratum(struct pool *pool)
 static void shutdown_stratum(struct pool *pool)
 {
 {
 	// Shut down Stratum as if we never had it
 	// Shut down Stratum as if we never had it
+	pool->stratum_active = false;
+	pool->stratum_auth = false;
 	pool->has_stratum = false;
 	pool->has_stratum = false;
 	shutdown(pool->sock, SHUT_RDWR);
 	shutdown(pool->sock, SHUT_RDWR);
 	free(pool->stratum_url);
 	free(pool->stratum_url);
@@ -5581,22 +5583,9 @@ static void *stratum_thread(void *userdata)
 			if (initiate_stratum(pool) && auth_stratum(pool))
 			if (initiate_stratum(pool) && auth_stratum(pool))
 				continue;
 				continue;
 
 
-			if (pool->rpc_url[0] != 's') {
-				shutdown_stratum(pool);
-				pool_active(pool, false);
-				break;
-			}
-
+			shutdown_stratum(pool);
 			pool_died(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))
 		if (!parse_method(pool, s) && !parse_stratum_response(pool, s))
@@ -5756,8 +5745,6 @@ retry_stratum:
 			finish_req_in_progress(pool, false);
 			finish_req_in_progress(pool, false);
 			return false;
 			return false;
 		}
 		}
-		pool->idle = false;
-		pool->stratum_auth = true;
 		init_stratum_thread(pool);
 		init_stratum_thread(pool);
 		detect_algo = 2;
 		detect_algo = 2;
 		finish_req_in_progress(pool, true);
 		finish_req_in_progress(pool, true);

+ 2 - 0
util.c

@@ -1404,6 +1404,7 @@ bool auth_stratum(struct pool *pool)
 	ret = true;
 	ret = true;
 	applog(LOG_INFO, "Stratum authorisation success for pool %d", pool->pool_no);
 	applog(LOG_INFO, "Stratum authorisation success for pool %d", pool->pool_no);
 	pool->probed = true;
 	pool->probed = true;
+	pool->stratum_auth = true;
 	successful_connect = true;
 	successful_connect = true;
 out:
 out:
 	if (val)
 	if (val)
@@ -1424,6 +1425,7 @@ bool initiate_stratum(struct pool *pool)
 	mutex_lock(&pool->stratum_lock);
 	mutex_lock(&pool->stratum_lock);
 	pool->swork.transparency_time = (time_t)-1;
 	pool->swork.transparency_time = (time_t)-1;
 	pool->stratum_active = false;
 	pool->stratum_active = false;
+	pool->stratum_auth = false;
 	pool->swork.transparency_probed = false;
 	pool->swork.transparency_probed = false;
 	if (!pool->stratum_curl) {
 	if (!pool->stratum_curl) {
 		pool->stratum_curl = curl_easy_init();
 		pool->stratum_curl = curl_easy_init();