Browse Source

Merge branch 'stratum_2' into bfgminer

Luke Dashjr 13 years ago
parent
commit
f216223891
2 changed files with 5 additions and 3 deletions
  1. 4 0
      miner.c
  2. 1 3
      util.c

+ 4 - 0
miner.c

@@ -5478,6 +5478,10 @@ static void *stratum_thread(void *userdata)
 			pool->getfail_occasions++;
 			pool->getfail_occasions++;
 			total_go++;
 			total_go++;
 
 
+			// Make any pending work/shares stale
+			pool->submit_old = false;
+			++pool->work_restart_id;
+
 			/* If the socket to our stratum pool disconnects, all
 			/* If the socket to our stratum pool disconnects, all
 			 * tracked submitted shares are lost and we will leak
 			 * tracked submitted shares are lost and we will leak
 			 * the memory if we don't discard their records. */
 			 * the memory if we don't discard their records. */

+ 1 - 3
util.c

@@ -906,9 +906,7 @@ static void clear_sock(struct pool *pool)
 	char buf[RECVSIZE];
 	char buf[RECVSIZE];
 
 
 	mutex_lock(&pool->stratum_lock);
 	mutex_lock(&pool->stratum_lock);
-	/* Ignore return code of curl_easy_recv since we're just clearing
-	 * anything in the socket if it's still alive */
-	while (CURLE_AGAIN != curl_easy_recv(pool->stratum_curl, buf, RECVSIZE, &n))
+	while (CURLE_OK == curl_easy_recv(pool->stratum_curl, buf, RECVSIZE, &n))
 	{}
 	{}
 	mutex_unlock(&pool->stratum_lock);
 	mutex_unlock(&pool->stratum_lock);
 }
 }