Browse Source

Use delete_init on the DL lists used in stratifier for thoroughness

master
Con Kolivas 10 years ago
parent
commit
3c3621cc43
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -881,7 +881,7 @@ static void __add_dead(sdata_t *sdata, stratum_instance_t *client)
static void __del_dead(sdata_t *sdata, stratum_instance_t *client) static void __del_dead(sdata_t *sdata, stratum_instance_t *client)
{ {
LOGDEBUG("Deleting dead instance %ld", client->id); LOGDEBUG("Deleting dead instance %ld", client->id);
DL_DELETE(sdata->dead_instances, client); DL_DELETE_INIT(sdata->dead_instances, client);
sdata->stats.dead--; sdata->stats.dead--;
} }
@ -1122,7 +1122,7 @@ static void __drop_client(sdata_t *sdata, stratum_instance_t *client, user_insta
HASH_DEL(sdata->stratum_instances, client); HASH_DEL(sdata->stratum_instances, client);
if (instance) if (instance)
DL_DELETE(instance->instances, client); DL_DELETE_INIT(instance->instances, client);
HASH_FIND(hh, sdata->disconnected_instances, &client->enonce1_64, sizeof(uint64_t), old_client); HASH_FIND(hh, sdata->disconnected_instances, &client->enonce1_64, sizeof(uint64_t), old_client);
/* Only keep around one copy of the old client in server mode */ /* Only keep around one copy of the old client in server mode */
if (!client->ckp->proxy && !old_client && client->enonce1_64 && client->authorised) { if (!client->ckp->proxy && !old_client && client->enonce1_64 && client->authorised) {
@ -1431,7 +1431,7 @@ static void block_solve(ckpool_t *ckp, const char *blockhash)
if (!strcmp(solvehash, blockhash)) { if (!strcmp(solvehash, blockhash)) {
dealloc(solvehash); dealloc(solvehash);
found = block; found = block;
DL_DELETE(sdata->block_solves, block); DL_DELETE_INIT(sdata->block_solves, block);
break; break;
} }
dealloc(solvehash); dealloc(solvehash);
@ -1478,7 +1478,7 @@ static void block_reject(sdata_t *sdata, const char *blockhash)
if (!strcmp(solvehash, blockhash)) { if (!strcmp(solvehash, blockhash)) {
dealloc(solvehash); dealloc(solvehash);
found = block; found = block;
DL_DELETE(sdata->block_solves, block); DL_DELETE_INIT(sdata->block_solves, block);
break; break;
} }
dealloc(solvehash); dealloc(solvehash);

Loading…
Cancel
Save