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

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
cfbcc9c25d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      miner.c

+ 3 - 0
miner.c

@@ -5868,7 +5868,10 @@ static void *stratum_thread(void *userdata)
 			total_go++;
 
 			// Make any pending work/shares stale
+			mutex_lock(&pool->stratum_lock);
+			pool->stratum_active = pool->stratum_notify = false;
 			pool->sock = INVSOCK;
+			mutex_unlock(&pool->stratum_lock);
 			pool->submit_old = false;
 			++pool->work_restart_id;