Browse Source

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

nfactor-troky
ckolivas 13 years ago
parent
commit
d5dffa6aad
  1. 6
      cgminer.c

6
cgminer.c

@ -2278,9 +2278,6 @@ static bool stale_work(struct work *work, bool share)
struct pool *pool; struct pool *pool;
int getwork_delay; int getwork_delay;
if (work->mandatory)
return false;
if (share) { if (share) {
/* Technically the rolltime should be correct but some pools /* Technically the rolltime should be correct but some pools
* advertise a broken expire= that is lower than a meaningful * advertise a broken expire= that is lower than a meaningful
@ -2316,7 +2313,7 @@ static bool stale_work(struct work *work, bool share)
return true; return true;
} }
if (opt_fail_only && !share && pool != current_pool() && pool->enabled != POOL_REJECTING) { if (opt_fail_only && !share && pool != current_pool() && !work->mandatory) {
applog(LOG_DEBUG, "Work stale due to fail only pool mismatch"); applog(LOG_DEBUG, "Work stale due to fail only pool mismatch");
return true; return true;
} }
@ -3842,6 +3839,7 @@ static struct work *make_clone(struct work *work)
memcpy(work_clone, work, sizeof(struct work)); memcpy(work_clone, work, sizeof(struct work));
work_clone->clone = true; work_clone->clone = true;
work_clone->longpoll = false; work_clone->longpoll = false;
work_clone->mandatory = false;
/* Make cloned work appear slightly older to bias towards keeping the /* Make cloned work appear slightly older to bias towards keeping the
* master work item which can be further rolled */ * master work item which can be further rolled */
work_clone->tv_staged.tv_sec -= 1; work_clone->tv_staged.tv_sec -= 1;

Loading…
Cancel
Save