Browse Source

Bugfix: On stratum disconnect, clear stratum_active and stratum_notify atomically along with sock

Fixes a crash when stratum_write attempts to FD_SET a -1 fd
Luke Dashjr 12 years ago
parent
commit
69813a7ed2
1 changed files with 3 additions and 0 deletions
  1. 3 0
      miner.c

+ 3 - 0
miner.c

@@ -6154,7 +6154,10 @@ static void *stratum_thread(void *userdata)
 			pool->getfail_occasions++;
 			total_go++;
 
+			mutex_lock(&pool->stratum_lock);
+			pool->stratum_active = pool->stratum_notify = false;
 			pool->sock = INVSOCK;
+			mutex_unlock(&pool->stratum_lock);
 
 			/* If the socket to our stratum pool disconnects, all
 			 * submissions need to be discarded or resent. */