Browse Source

Protect pool name with lock

idlebug
elbandi 11 years ago
parent
commit
f9a2c8b929
  1. 4
      api.c

4
api.c

@ -1818,7 +1818,9 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m @@ -1818,7 +1818,9 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
lp = (char *)NO;
root = api_add_int(root, "POOL", &i, false);
root = api_add_string(root, "Name", get_pool_name(pool), false);
mutex_lock(&pool->stratum_lock);
root = api_add_string(root, "Name", get_pool_name(pool), true);
mutex_unlock(&pool->stratum_lock);
root = api_add_escape(root, "URL", pool->rpc_url, false);
root = api_add_string(root, "Algorithm", pool->algorithm.name, false);
root = api_add_string(root, "Description", pool->description, false);

Loading…
Cancel
Save