Browse Source

Merge branch 'cg_merges_20121219' into bfgminer

Luke Dashjr 13 years ago
parent
commit
ec9800cd80
2 changed files with 45 additions and 2 deletions
  1. 22 0
      NEWS
  2. 23 2
      miner.c

+ 22 - 0
NEWS

@@ -1,5 +1,27 @@
 BFGMiner Version 2.10.1 - Future
 
+- Stop all work from the current pool if it's a stratum pool once it is
+disconnected since it will be invalid upon reconnecting.
+- Discard all staged work from stratum pools as well as the shares upon
+disconnection since all the work becomes invalid.
+- Use correct cbreak after 15 second delay when no pool is found alive.
+- MMQ missing firmware -> ERR not DEBUG
+- Allow stratum to work with scrypt.
+- MMQ ensure delta clock can never exceed limits
+- MMQ lowercase new string constants
+- MMQ add api pgaset for clock
+- API V1.23 - new pgaset command, to be used soon
+- Protect the best_share/best_diff values under control lock.
+- MMQ style police
+- MMQ count work check timeout failures
+- MMQ allow partial work replies and count them
+- Check a stratum pool hasn't gone dead while being a backup pool and missed
+having its idle flag cleared.
+- MMQ overheat: remove clockdown (doesn't help) + ensure no lost shares
+- API-README grammar
+- API-README explain custom page extensions in miner.php
+- miner.php add a sample group pool report
+- miner.php allow where,group,having on cumstom pages
 - Check for EWOULDBLOCK when supported in send and recv as well.
 - Use the raw send() command instead of curl_easy_send since curl raw socket
 usage introduces random bugs on windows.

+ 23 - 2
miner.c

@@ -5475,6 +5475,22 @@ static void clear_stratum_shares(struct pool *pool)
 	}
 }
 
+static void clear_pool_work(struct pool *pool)
+{
+	struct work *work, *tmp;
+	int cleared = 0;
+
+	mutex_lock(stgd_lock);
+	HASH_ITER(hh, staged_work, work, tmp) {
+		if (work->pool == pool) {
+			HASH_DEL(staged_work, work);
+			free_work(work);
+			cleared++;
+		}
+	}
+	mutex_unlock(stgd_lock);
+}
+
 /* We only need to maintain a secondary pool connection when we need the
  * capacity to get work from the backup pools while still on the primary */
 static bool cnx_needed(struct pool *pool)
@@ -5538,6 +5554,9 @@ static void *stratum_thread(void *userdata)
 		 * pool */
 		if (!cnx_needed(pool)) {
 			suspend_stratum(pool);
+			clear_stratum_shares(pool);
+			clear_pool_work(pool);
+
 			wait_lpcurrent(pool);
 			if (!initiate_stratum(pool) || !auth_stratum(pool)) {
 				pool_died(pool);
@@ -5578,6 +5597,9 @@ static void *stratum_thread(void *userdata)
 			 * tracked submitted shares are lost and we will leak
 			 * the memory if we don't discard their records. */
 			clear_stratum_shares(pool);
+			clear_pool_work(pool);
+			if (pool == current_pool())
+				restart_threads();
 
 			if (initiate_stratum(pool) && auth_stratum(pool))
 				continue;
@@ -7822,7 +7844,7 @@ int main(int argc, char *argv[])
 				applog(LOG_ERR, "Press any key to exit, or BFGMiner will try again in 15s.");
 				if (getch() != ERR)
 					quit(0, "No servers could be used! Exiting.");
-				nocbreak();
+				cbreak();
 			} else
 #endif
 				quit(0, "No servers could be used! Exiting.");
@@ -8015,7 +8037,6 @@ begin_bench:
 			total_go++;
 		}
 		pool = select_pool(lagging);
-		lagging = false;
 retry:
 		if (pool->has_stratum) {
 			while (!pool->stratum_active) {