Skip to content

Commit

Permalink
Use main stratum instead of backup if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-zurkowski committed Oct 12, 2021
1 parent 094ac34 commit c2de661
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c2de661

Please sign in to comment.