Skip to content

Commit

Permalink
new --submit-stale parameter (tpruvot#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Oct 9, 2017
1 parent 5a90db1 commit e505d10
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool allow_gbt = true;
bool allow_mininginfo = true;
bool check_dups = true; //false;
bool check_stratum_jobs = false;

bool opt_submit_stale = false;
bool submit_old = false;
bool use_syslog = false;
bool use_colors = true;
Expand Down Expand Up @@ -319,6 +319,7 @@ Options:\n\
-T, --timeout=N network timeout, in seconds (default: 300)\n\
-s, --scantime=N upper bound on time spent scanning current work when\n\
long polling is unavailable, in seconds (default: 10)\n\
--submit-stale ignore stale jobs checks, may create more rejected shares\n\
-n, --ndevs list cuda devices\n\
-N, --statsavg number of samples used to compute hashrate (default: 30)\n\
--no-gbt disable getblocktemplate support (height check in solo)\n\
Expand Down Expand Up @@ -431,7 +432,8 @@ struct option options[] = {
{ "retries", 1, NULL, 'r' },
{ "retry-pause", 1, NULL, 'R' },
{ "scantime", 1, NULL, 's' },
{ "show-diff", 0, NULL, 1013 },
{ "show-diff", 0, NULL, 1013 }, // deprecated
{ "submit-stale", 0, NULL, 1015 },
{ "hide-diff", 0, NULL, 1014 },
{ "statsavg", 1, NULL, 'N' },
{ "gpu-clock", 1, NULL, 1070 },
Expand Down Expand Up @@ -897,7 +899,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work)

/* discard if a newer block was received */
stale_work = work->height && work->height < g_work.height;
if (have_stratum && !stale_work && opt_algo != ALGO_ZR5 && opt_algo != ALGO_SCRYPT_JANE) {
if (have_stratum && !stale_work && !opt_submit_stale && opt_algo != ALGO_ZR5 && opt_algo != ALGO_SCRYPT_JANE) {
pthread_mutex_lock(&g_work_lock);
if (strlen(work->job_id + 8))
stale_work = strncmp(work->job_id + 8, g_work.job_id + 8, sizeof(g_work.job_id) - 8);
Expand Down Expand Up @@ -3530,6 +3532,9 @@ void parse_arg(int key, char *arg)
case 1014:
opt_showdiff = false;
break;
case 1015:
opt_submit_stale = true;
break;
case 'S':
case 1018:
applog(LOG_INFO, "Now logging to syslog...");
Expand Down

0 comments on commit e505d10

Please sign in to comment.