Skip to content

Commit

Permalink
stratum: add --diff-multiplier option (-m)
Browse files Browse the repository at this point in the history
and rename --diff to --diff-factor (-f), --diff is kept for compat.

These options are generally for dev purpose or when we setup
a new pool on a new algo... help pool owners to test different
difficulty settings...
  • Loading branch information
tpruvot committed Jun 25, 2015
1 parent 397441d commit a6b682c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ Options:\n\
-T, --timeout=N timeout for long poll and stratum (default: 300 seconds)\n\
-s, --scantime=N upper bound on time spent scanning current work when\n\
long polling is unavailable, in seconds (default: 5)\n\
-f, --diff Divide difficulty by this factor (std is 1) \n\
-f, --diff-factor Divide req. difficulty by this factor (std is 1.0)\n\
-m, --diff-multiplier Multiply difficulty by this factor (std is 1.0)\n\
-n, --nfactor neoscrypt N-Factor\n\
--coinbase-addr=ADDR payout address for solo mining\n\
--coinbase-sig=TEXT data to insert in the coinbase when possible\n\
Expand Down Expand Up @@ -312,7 +313,7 @@ static char const short_options[] =
#ifdef HAVE_SYSLOG_H
"S"
#endif
"a:b:Bc:CDhp:Px:qr:R:s:t:T:o:u:O:Vn:f:";
"a:b:Bc:CDf:hm:n:p:Px:qr:R:s:t:T:o:u:O:V";

static struct option const options[] = {
{ "algo", 1, NULL, 'a' },
Expand All @@ -329,8 +330,10 @@ static struct option const options[] = {
{ "cpu-priority", 1, NULL, 1021 },
{ "no-color", 0, NULL, 1002 },
{ "debug", 0, NULL, 'D' },
{ "diff-factor", 1, NULL, 'f' },
{ "diff", 1, NULL, 'f' }, // deprecated (alias)
{ "diff-multiplier", 1, NULL, 'm' },
{ "help", 0, NULL, 'h' },
{ "diff", 1, NULL, 'f' },
{ "nfactor", 1, NULL, 'n' },
{ "no-gbt", 0, NULL, 1011 },
{ "no-getwork", 0, NULL, 1010 },
Expand Down Expand Up @@ -2836,10 +2839,16 @@ void parse_arg(int key, char *arg)
break;
case 'f':
d = atof(arg);
if (d == 0) /* sanity check */
if (d == 0.) /* --diff-factor */
show_usage_and_exit(1);
opt_diff_factor = d;
break;
case 'm':
d = atof(arg);
if (d == 0.) /* --diff-multiplier */
show_usage_and_exit(1);
opt_diff_factor = 1.0/d;
break;
case 'S':
use_syslog = true;
use_colors = false;
Expand Down

0 comments on commit a6b682c

Please sign in to comment.