From c2de661660ce6d31e55fc63e7de59b7a4d4edf61 Mon Sep 17 00:00:00 2001 From: Michal Zurkowski Date: Tue, 12 Oct 2021 18:28:15 +0000 Subject: [PATCH] Use main stratum instead of backup if possible. --- cpu-miner.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cpu-miner.c b/cpu-miner.c index ef6460b..1d95510 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -1408,7 +1408,7 @@ static void donation_switch() { rpc_user = strdup(rpc_user_original); free(rpc_pass); rpc_pass = strdup(rpc_pass_original); - if (switched_stratum) { + if (switched_stratum || (url_backup && rpc_url_backup != NULL)) { free(rpc_url); rpc_url = strdup(rpc_url_original); short_url = &rpc_url[sizeof("stratum+tcp://") - 1]; @@ -3207,9 +3207,7 @@ static void *stratum_thread(void *userdata) { } while (1) { - if (enable_donation) { - donation_switch(); - } + donation_switch(); if (!stratum_check(false)) { // Only if opt_retries are set and not dev_mining.