From ef6ad423e3ab9f07354039d271c40a9317ca0fcf Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 10 Oct 2012 23:46:49 +1100 Subject: [PATCH] Only copy the stratum url to the rpc url if an rpc url does not exist. --- cgminer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 27de6cbc..05729e06 100644 --- a/cgminer.c +++ b/cgminer.c @@ -588,7 +588,8 @@ static char *set_url(char *arg) arg = get_proxy(arg, pool); if (detect_stratum(pool, arg)) { - pool->rpc_url = strdup(pool->stratum_url); + if (!pool->rpc_url) + pool->rpc_url = strdup(pool->stratum_url); return NULL; } @@ -4285,7 +4286,8 @@ retry_stratum: * and if so, switch to that in preference to getwork if it works */ if (pool->stratum_url && stratum_works(pool)) { applog(LOG_NOTICE, "Switching pool %d %s to %s", pool->pool_no, pool->rpc_url, pool->stratum_url); - pool->rpc_url = strdup(pool->stratum_url); + if (!pool->rpc_url) + pool->rpc_url = strdup(pool->stratum_url); pool->has_stratum = true; curl_easy_cleanup(curl);