Browse Source

Merge branch 'cgminer' into bfgminer

Luke Dashjr 13 years ago
parent
commit
3585a96dbb
1 changed files with 3 additions and 6 deletions
  1. 3 6
      miner.c

+ 3 - 6
miner.c

@@ -2868,7 +2868,8 @@ static void discard_stale(void)
 
 
 	if (stale) {
 	if (stale) {
 		applog(LOG_DEBUG, "Discarded %d stales that didn't match current hash", stale);
 		applog(LOG_DEBUG, "Discarded %d stales that didn't match current hash", stale);
-		queue_request(NULL, false);
+		while (stale-- > 0)
+			queue_request(NULL, false);
 	}
 	}
 }
 }
 
 
@@ -4216,7 +4217,6 @@ bool queue_request(struct thr_info *thr, bool needed)
 static struct work *hash_pop(const struct timespec *abstime)
 static struct work *hash_pop(const struct timespec *abstime)
 {
 {
 	struct work *work = NULL;
 	struct work *work = NULL;
-	bool queue = false;
 	int rc = 0;
 	int rc = 0;
 
 
 	mutex_lock(stgd_lock);
 	mutex_lock(stgd_lock);
@@ -4227,13 +4227,10 @@ static struct work *hash_pop(const struct timespec *abstime)
 		work = staged_work;
 		work = staged_work;
 		HASH_DEL(staged_work, work);
 		HASH_DEL(staged_work, work);
 		work->pool->staged--;
 		work->pool->staged--;
-		if (HASH_COUNT(staged_work) < (unsigned int)mining_threads)
-			queue = true;
 	}
 	}
 	mutex_unlock(stgd_lock);
 	mutex_unlock(stgd_lock);
 
 
-	if (queue)
-		queue_request(NULL, false);
+	queue_request(NULL, false);
 
 
 	return work;
 	return work;
 }
 }