Skip to content

Commit

Permalink
From the tpruvot branch: prevent gpu scans before a job is recieved.
Browse files Browse the repository at this point in the history
  • Loading branch information
runestensland committed Jun 3, 2015
1 parent c486171 commit 8f7f6df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
gettimeofday(&stratum.tv_submit, NULL);
if (unlikely(!stratum_send_line(&stratum, s))) {
applog(LOG_ERR, "submit_upstream_work stratum_send_line failed");
sleep(10);
return false;
}

Expand Down Expand Up @@ -1322,6 +1323,13 @@ static void *miner_thread(void *userdata)
work_restart[thr_id].restart = 0;
pthread_mutex_unlock(&g_work_lock);

/* prevent gpu scans before a job is received */
if (have_stratum && loopcnt>0 && work.data[0] == 0)
{
sleep(1);
continue;
}

/* adjust max_nonce to meet target scan time */
if (have_stratum)
max64 = LP_SCANTIME;
Expand Down

0 comments on commit 8f7f6df

Please sign in to comment.