Browse Source

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

Con Kolivas 13 years ago
parent
commit
ad02627e6b
1 changed files with 2 additions and 4 deletions
  1. 2 4
      cgminer.c

+ 2 - 4
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;