From 53a199a21dbae03d6359e222fa5fd82621826985 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Mon, 7 Apr 2014 22:21:57 +0300 Subject: [PATCH] config: use get_pool_name() in set_pool_algorithm() and set_pool_nfactor(). --- sgminer.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sgminer.c b/sgminer.c index f056cc7a..47d712fe 100644 --- a/sgminer.c +++ b/sgminer.c @@ -783,11 +783,7 @@ static char *set_url(char *arg) static char *set_pool_algorithm(char *arg) { - struct pool *pool; - - while ((json_array_index + 1) > total_pools) - add_pool(); - pool = pools[json_array_index]; + struct pool *pool = get_current_pool(); applog(LOG_DEBUG, "Setting pool %i algorithm to %s", pool->pool_no, arg); set_algorithm(&pool->algorithm, arg); @@ -797,11 +793,7 @@ static char *set_pool_algorithm(char *arg) static char *set_pool_nfactor(char *arg) { - struct pool *pool; - - while ((json_array_index + 1) > total_pools) - add_pool(); - pool = pools[json_array_index]; + struct pool *pool = get_current_pool(); applog(LOG_DEBUG, "Setting pool %i N-factor to %s", pool->pool_no, arg); set_algorithm_nfactor(&pool->algorithm, (const uint8_t) atoi(arg));