Browse Source

Don't make mandatory work and its clones last forever.

ckolivas 13 years ago
parent
commit
2731622696
1 changed files with 2 additions and 3 deletions
  1. 2 3
      miner.c

+ 2 - 3
miner.c

@@ -2542,8 +2542,6 @@ static bool stale_work3(struct work *work, bool share, bool failoveronly)
 	uint32_t block_id;
 	int getwork_delay;
 
-	if (work->mandatory)
-		return false;
 
 	block_id = ((uint32_t*)work->data)[1];
 	pool = work->pool;
@@ -2611,7 +2609,7 @@ static bool stale_work3(struct work *work, bool share, bool failoveronly)
 
 	/* If the user only wants strict failover, any work from a pool other than
 	 * the current one is always considered stale */
-	if (failoveronly && !share && pool != current_pool() && pool->enabled != POOL_REJECTING) {
+	if (failoveronly && !share && pool != current_pool() && !work->mandatory) {
 		applog(LOG_DEBUG, "Work stale due to fail only pool mismatch (pool %u vs %u)", pool->pool_no, current_pool()->pool_no);
 		return true;
 	}
@@ -4305,6 +4303,7 @@ static struct work *make_clone(struct work *work)
 	memcpy(work_clone, work, sizeof(struct work));
 	work_clone->clone = true;
 	work_clone->longpoll = false;
+	work_clone->mandatory = false;
 	/* Make cloned work appear slightly older to bias towards keeping the
 	 * master work item which can be further rolled */
 	work_clone->tv_staged.tv_sec -= 1;