mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Set the pool idle and switch pool, if need
This commit is contained in:
parent
c72cd9160e
commit
28ff05e327
1
miner.h
1
miner.h
@ -1420,6 +1420,7 @@ extern bool log_curses_only(int prio, const char *datetime, const char *str);
|
|||||||
extern void clear_logwin(void);
|
extern void clear_logwin(void);
|
||||||
extern void logwin_update(void);
|
extern void logwin_update(void);
|
||||||
extern bool pool_tclear(struct pool *pool, bool *var);
|
extern bool pool_tclear(struct pool *pool, bool *var);
|
||||||
|
extern void pool_failed(struct pool *pool);
|
||||||
extern struct thread_q *tq_new(void);
|
extern struct thread_q *tq_new(void);
|
||||||
extern void tq_free(struct thread_q *tq);
|
extern void tq_free(struct thread_q *tq);
|
||||||
extern bool tq_push(struct thread_q *tq, void *data);
|
extern bool tq_push(struct thread_q *tq, void *data);
|
||||||
|
10
sgminer.c
10
sgminer.c
@ -3619,6 +3619,16 @@ struct work *copy_work_noffset(struct work *base_work, int noffset)
|
|||||||
return work;
|
return work;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pool_failed(struct pool *pool)
|
||||||
|
{
|
||||||
|
if (!pool_tset(pool, &pool->idle)) {
|
||||||
|
cgtime(&pool->tv_idle);
|
||||||
|
if (pool == current_pool()) {
|
||||||
|
switch_pools(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void pool_died(struct pool *pool)
|
static void pool_died(struct pool *pool)
|
||||||
{
|
{
|
||||||
if (!pool_tset(pool, &pool->idle)) {
|
if (!pool_tset(pool, &pool->idle)) {
|
||||||
|
4
util.c
4
util.c
@ -1743,8 +1743,10 @@ static bool parse_reconnect(struct pool *pool, json_t *val)
|
|||||||
free(tmp);
|
free(tmp);
|
||||||
mutex_unlock(&pool->stratum_lock);
|
mutex_unlock(&pool->stratum_lock);
|
||||||
|
|
||||||
if (!restart_stratum(pool))
|
if (!restart_stratum(pool)) {
|
||||||
|
pool_failed(pool);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user