Browse Source

Call disable_pool() at the begin of remove_pool() and combine them when appears together in the code

Signed-off-by: Huang Le <4tarhl@gmail.com>
Huang Le 11 years ago
parent
commit
fef4ae7c92
2 changed files with 2 additions and 5 deletions
  1. 0 1
      api.c
  2. 2 4
      miner.c

+ 0 - 1
api.c

@@ -2595,7 +2595,6 @@ static void removepool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
 		return;
 		return;
 	}
 	}
 
 
-	disable_pool(pool);
 	rpc_url = escape_string(pool->rpc_url, isjson);
 	rpc_url = escape_string(pool->rpc_url, isjson);
 	if (rpc_url != pool->rpc_url)
 	if (rpc_url != pool->rpc_url)
 		dofree = true;
 		dofree = true;

+ 2 - 4
miner.c

@@ -6864,6 +6864,8 @@ void remove_pool(struct pool *pool)
 	int i, last_pool = total_pools - 1;
 	int i, last_pool = total_pools - 1;
 	struct pool *other;
 	struct pool *other;
 
 
+	disable_pool(pool);
+	
 	/* Boost priority of any lower prio than this one */
 	/* Boost priority of any lower prio than this one */
 	for (i = 0; i < total_pools; i++) {
 	for (i = 0; i < total_pools; i++) {
 		other = pools[i];
 		other = pools[i];
@@ -7294,7 +7296,6 @@ retry:
 			wlogprint("Unable to remove pool due to activity\n");
 			wlogprint("Unable to remove pool due to activity\n");
 			goto retry;
 			goto retry;
 		}
 		}
-		disable_pool(pool);
 		remove_pool(pool);
 		remove_pool(pool);
 		goto updated;
 		goto updated;
 	} else if (!strncasecmp(&input, "s", 1)) {
 	} else if (!strncasecmp(&input, "s", 1)) {
@@ -12334,10 +12335,7 @@ int main(int argc, char *argv[])
 	
 	
 	if (opt_benchmark) {
 	if (opt_benchmark) {
 		while (total_pools)
 		while (total_pools)
-		{
-			disable_pool(pools[0]);
 			remove_pool(pools[0]);
 			remove_pool(pools[0]);
-		}
 
 
 		setup_benchmark_pool();
 		setup_benchmark_pool();
 	}
 	}