Browse Source

Use longpolls from backup pools with failover-only enabled just to check for block changes, but don't use them as work.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
03abb70467
  1. 12
      cgminer.c

12
cgminer.c

@ -3798,10 +3798,6 @@ static void convert_to_work(json_t *val, bool rolltime, struct pool *pool)
struct work *work, *work_clone; struct work *work, *work_clone;
bool rc; bool rc;
/* Don't use as work if we have failover-only enabled */
if (pool != cp && opt_fail_only)
return;
work = make_work(); work = make_work();
rc = work_decode(json_object_get(val, "result"), work); rc = work_decode(json_object_get(val, "result"), work);
@ -3814,7 +3810,7 @@ static void convert_to_work(json_t *val, bool rolltime, struct pool *pool)
work->rolltime = rolltime; work->rolltime = rolltime;
/* Only flag this as longpoll work if the pool is the current pool */ /* Only flag this as longpoll work if the pool is the current pool */
if (pool == cp) if (pool == current_pool())
work->longpoll = true; work->longpoll = true;
/* We'll be checking this work item twice, but we already know it's /* We'll be checking this work item twice, but we already know it's
@ -3823,6 +3819,12 @@ static void convert_to_work(json_t *val, bool rolltime, struct pool *pool)
* allows testwork to know whether LP discovered the block or not. */ * allows testwork to know whether LP discovered the block or not. */
test_work_current(work); test_work_current(work);
/* Don't use as work if we have failover-only enabled */
if (!work->longpoll && opt_fail_only) {
free_work(work);
return;
}
work_clone = make_work(); work_clone = make_work();
memcpy(work_clone, work, sizeof(struct work)); memcpy(work_clone, work, sizeof(struct work));
while (reuse_work(work)) { while (reuse_work(work)) {

Loading…
Cancel
Save