Commit ad02627e6b0bb667ab1ba053e75646884b0e7b0e

Con Kolivas 2012-07-06T19:35:28

Fix --benchmark not working since the dynamic addition of pools and pool stats.

diff --git a/cgminer.c b/cgminer.c
index 74ea9df..dc22703 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1852,6 +1852,7 @@ static void get_benchmark_work(struct work *work)
 	memset(work, 0, sizeof(work));
 	memcpy(work, &bench_block, min_size);
 	work->mandatory = true;
+	work->pool = pools[0];
 }
 
 static bool get_upstream_work(struct work *work, CURL *curl)
@@ -5131,10 +5132,7 @@ int main(int argc, char *argv[])
 	if (opt_benchmark) {
 		struct pool *pool;
 
-		pool = calloc(sizeof(struct pool), 1);
-		pool->pool_no = 0;
-		pools[total_pools++] = pool;
-		pthread_mutex_init(&pool->pool_lock, NULL);
+		pool = add_pool();
 		pool->rpc_url = malloc(255);
 		strcpy(pool->rpc_url, "Benchmark");
 		pool->rpc_user = pool->rpc_url;