Browse Source

Merge commit '8fdf6d5' into cg_merges_20130304a

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
7c27af0f26
1 changed files with 15 additions and 2 deletions
  1. 15 2
      miner.c

+ 15 - 2
miner.c

@@ -5977,6 +5977,16 @@ static void stratum_resumed(struct pool *pool)
 	}
 }
 
+static bool supports_resume(struct pool *pool)
+{
+	bool ret;
+
+	mutex_lock(&pool->pool_lock);
+	ret = (pool->sessionid != NULL);
+	mutex_unlock(&pool->pool_lock);
+	return ret;
+}
+
 /* One stratum thread per pool that has stratum waits on the socket checking
  * for new messages and for the integrity of the socket connection. We reset
  * the connection based on the integrity of the receive side only as the send
@@ -6041,8 +6051,11 @@ static void *stratum_thread(void *userdata)
 			pool->sock = INVSOCK;
 
 			/* If the socket to our stratum pool disconnects, all
-			 * submissions need to be resent. */
-			resubmit_stratum_shares(pool);
+			 * submissions need to be discarded or resent. */
+			if (!supports_resume(pool))
+				clear_stratum_shares(pool);
+			else
+				resubmit_stratum_shares(pool);
 			clear_pool_work(pool);
 			if (pool == current_pool())
 				restart_threads();