mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-09 20:21:01 +00:00
Use longpolls from backup pools with failover-only enabled just to check for block changes, but don't use them as work.
This commit is contained in:
parent
1ab318d0f3
commit
03abb70467
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…
x
Reference in New Issue
Block a user