Browse Source

Avoid waiting for local bitcoind test if we have other pools defined already

Luke Dashjr 11 years ago
parent
commit
90097f9813
1 changed files with 6 additions and 5 deletions
  1. 6 5
      miner.c

+ 6 - 5
miner.c

@@ -10954,8 +10954,9 @@ out:
 #endif
 
 static
-bool _add_local_gbt(const char * const filepath, void * __maybe_unused userp)
+bool _add_local_gbt(const char * const filepath, void *userp)
 {
+	const bool * const live_p = userp;
 	struct pool *pool;
 	char buf[0x100];
 	char *rpcuser = NULL, *rpcpass = NULL;
@@ -11019,7 +11020,7 @@ err:
 	pool->quota = 0;
 	adjust_quota_gcd();
 	pool->failover_only = true;
-	add_pool_details(pool, false, uri, rpcuser, rpcpass);
+	add_pool_details(pool, *live_p, uri, rpcuser, rpcpass);
 	
 	applog(LOG_NOTICE, "Added local bitcoin RPC server on port %d as pool %d", rpcport, pool->pool_no);
 	
@@ -11028,9 +11029,9 @@ out:
 }
 
 static
-void add_local_gbt(void)
+void add_local_gbt(bool live)
 {
-	appdata_file_call("Bitcoin", "bitcoin.conf", _add_local_gbt, NULL);
+	appdata_file_call("Bitcoin", "bitcoin.conf", _add_local_gbt, &live);
 }
 
 #if defined(unix) || defined(__APPLE__)
@@ -12384,7 +12385,7 @@ int main(int argc, char *argv[])
 #endif
 
 	if (opt_load_bitcoin_conf && !(opt_scrypt || opt_benchmark))
-		add_local_gbt();
+		add_local_gbt(total_pools);
 	
 	if (!total_pools) {
 		applog(LOG_WARNING, "Need to specify at least one pool server.");