|
|
@ -1115,8 +1115,17 @@ static stratum_instance_t *__stratum_add_instance(ckpool_t *ckp, int64_t id, int |
|
|
|
/* Add a stratum instance to the dead instances list */ |
|
|
|
/* Add a stratum instance to the dead instances list */ |
|
|
|
static void kill_instance(sdata_t *sdata, stratum_instance_t *client) |
|
|
|
static void kill_instance(sdata_t *sdata, stratum_instance_t *client) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (client->user_instance) |
|
|
|
user_instance_t *instance = client->user_instance; |
|
|
|
DL_DELETE(client->user_instance->instances, client); |
|
|
|
|
|
|
|
|
|
|
|
if (instance) { |
|
|
|
|
|
|
|
worker_instance_t *worker = client->worker_instance; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DL_DELETE(instance->instances, client); |
|
|
|
|
|
|
|
if (worker) { |
|
|
|
|
|
|
|
DL_DELETE(instance->worker_instances, worker); |
|
|
|
|
|
|
|
free(worker); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
LL_PREPEND(sdata->dead_instances, client); |
|
|
|
LL_PREPEND(sdata->dead_instances, client); |
|
|
|
sdata->stats.dead++; |
|
|
|
sdata->stats.dead++; |
|
|
|
} |
|
|
|
} |
|
|
|