mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 13:04:29 +00:00
Clear last pool work on switching pools if the current pool supports local work generation or we are in failover only mode.
This commit is contained in:
parent
2fe415f42e
commit
016f065f69
@ -3343,6 +3343,8 @@ static struct pool *priority_pool(int choice)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clear_pool_work(struct pool *pool);
|
||||||
|
|
||||||
void switch_pools(struct pool *selected)
|
void switch_pools(struct pool *selected)
|
||||||
{
|
{
|
||||||
struct pool *pool, *last_pool;
|
struct pool *pool, *last_pool;
|
||||||
@ -3411,8 +3413,11 @@ void switch_pools(struct pool *selected)
|
|||||||
if (opt_fail_only)
|
if (opt_fail_only)
|
||||||
pool_tset(pool, &pool->lagging);
|
pool_tset(pool, &pool->lagging);
|
||||||
|
|
||||||
if (pool != last_pool && pool_strategy != POOL_LOADBALANCE && pool_strategy != POOL_BALANCE)
|
if (pool != last_pool && pool_strategy != POOL_LOADBALANCE && pool_strategy != POOL_BALANCE) {
|
||||||
applog(LOG_WARNING, "Switching to %s", pool->rpc_url);
|
applog(LOG_WARNING, "Switching to %s", pool->rpc_url);
|
||||||
|
if (pool->has_gbt || pool->has_stratum || opt_fail_only)
|
||||||
|
clear_pool_work(last_pool);
|
||||||
|
}
|
||||||
|
|
||||||
mutex_lock(&lp_lock);
|
mutex_lock(&lp_lock);
|
||||||
pthread_cond_broadcast(&lp_cond);
|
pthread_cond_broadcast(&lp_cond);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user