Browse Source

Bugfix: Stratum: Re-read pool sock var after suspend+restart

Luke Dashjr 12 years ago
parent
commit
f57668126e
1 changed files with 14 additions and 3 deletions
  1. 14 3
      miner.c

+ 14 - 3
miner.c

@@ -7357,12 +7357,23 @@ static void *stratum_thread(void *userdata)
 		if (unlikely(!pool->has_stratum))
 			break;
 
-		sock = pool->sock;
-		
 		/* Check to see whether we need to maintain this connection
 		 * indefinitely or just bring it up when we switch to this
 		 * pool */
-		if (sock == INVSOCK || (!sock_full(pool) && !cnx_needed(pool))) {
+		while (true)
+		{
+			sock = pool->sock;
+			
+			if (sock == INVSOCK)
+				applog(LOG_DEBUG, "Pool %u: Invalid socket, suspending",
+				       pool->pool_no);
+			else
+			if (!sock_full(pool) && !cnx_needed(pool))
+				applog(LOG_DEBUG, "Pool %u: Connection not needed, suspending",
+				       pool->pool_no);
+			else
+				break;
+			
 			suspend_stratum(pool);
 			clear_stratum_shares(pool);
 			clear_pool_work(pool);