Browse Source

Merge commit 'd168' into bfgminer

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
5160a458c4
1 changed files with 8 additions and 10 deletions
  1. 8 10
      miner.c

+ 8 - 10
miner.c

@@ -71,7 +71,6 @@ struct workio_cmd {
 	struct thr_info		*thr;
 	struct work		*work;
 	struct pool		*pool;
-	bool			needed;
 
 	struct list_head list;
 };
@@ -2570,7 +2569,7 @@ out:
 	return cloned;
 }
 
-static bool queue_request(bool needed);
+static bool queue_request(void);
 
 static void *get_work_thread(void *userdata)
 {
@@ -2608,7 +2607,7 @@ static void *get_work_thread(void *userdata)
 			/* pause, then restart work-request loop */
 			applog(LOG_DEBUG, "json_rpc_call failed on get work, retrying");
 			dec_queued(pool);
-			queue_request(wc->needed);
+			queue_request();
 			free_work(ret_work);
 			goto out;
 		}
@@ -2982,7 +2981,7 @@ static void discard_stale(void)
 	if (stale) {
 		applog(LOG_DEBUG, "Discarded %d stales that didn't match current hash", stale);
 		while (stale-- > 0)
-			queue_request(false);
+			queue_request();
 	}
 }
 
@@ -4316,7 +4315,7 @@ static void pool_resus(struct pool *pool)
 		switch_pools(NULL);
 }
 
-static bool queue_request(bool needed)
+static bool queue_request(void)
 {
 	int ts, tq, maxq = opt_queue + mining_threads;
 	struct pool *pool, *cp;
@@ -4328,10 +4327,10 @@ static bool queue_request(bool needed)
 		return true;
 
 	cp = current_pool();
-	if ((!needed || opt_fail_only) && (cp->staged + cp->queued >= maxq))
+	if (cp->staged + cp->queued >= maxq)
 		return true;
 
-	pool = select_pool(needed && !ts);
+	pool = select_pool(false);
 	if (pool->staged + pool->queued >= maxq)
 		return true;
 
@@ -4346,7 +4345,6 @@ static bool queue_request(bool needed)
 
 	wc->cmd = WC_GET_WORK;
 	wc->pool = pool;
-	wc->needed = needed;
 
 	applog(LOG_DEBUG, "Queueing getwork request to work thread");
 
@@ -4387,7 +4385,7 @@ static struct work *hash_pop(const struct timespec *abstime)
 	}
 	mutex_unlock(stgd_lock);
 
-	queue_request(false);
+	queue_request();
 
 	return work;
 }
@@ -6253,7 +6251,7 @@ begin_bench:
 #endif
 
 	for (i = 0; i < mining_threads + opt_queue; i++)
-		queue_request(false);
+		queue_request();
 
 	/* main loop - simply wait for workio thread to exit. This is not the
 	 * normal exit path and only occurs should the workio_thread die