Change default behaviour to submitting stale, removing the --submit-stale option and adding a --no-submit-stale option.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/README b/README
index 4298eca..d5260f8 100644
--- a/README
+++ b/README
@@ -133,6 +133,7 @@ Options for both config file and command line:
--log|-l <arg> Interval in seconds between log output (default: 5)
--monitor|-m <arg> Use custom pipe cmd for output messages
--net-delay Impose small delays in networking to not overload slow routers
+--no-submit-stale Don't submit shares if they are detected as stale
--pass|-p <arg> Password for bitcoin JSON-RPC server
--per-device-stats Force verbose mode and output per-device statistics
--protocol-dump|-P Verbose dump of protocol-level activities
@@ -150,7 +151,6 @@ Options for both config file and command line:
--sharelog <arg> Append share log to file
--shares <arg> Quit after mining N shares (default: unlimited)
--socks-proxy <arg> Set socks4 proxy (host:port)
---submit-stale Submit shares even if they would normally be considered stale
--syslog Use system log for output messages (default: standard error)
--temp-cutoff <arg> Temperature where a device will be automatically disabled, one value or comma separated list (default: 95)
--text-only|-T Disable ncurses formatted screen output
diff --git a/cgminer.c b/cgminer.c
index 84e8c98..37af3b9 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -123,7 +123,7 @@ bool use_curses =
false
#endif
;
-static bool opt_submit_stale;
+static bool opt_submit_stale = true;
static int opt_shares;
static bool opt_fail_only;
bool opt_autofan;
@@ -842,6 +842,9 @@ static struct opt_table opt_config_table[] = {
opt_hidden
#endif
),
+ OPT_WITHOUT_ARG("--no-submit-stale",
+ opt_set_invbool, &opt_submit_stale,
+ "Don't submit shares if they are detected as stale"),
OPT_WITH_ARG("--pass|-p",
set_pass, NULL, NULL,
"Password for bitcoin JSON-RPC server"),
@@ -898,9 +901,6 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--socks-proxy",
opt_set_charp, NULL, &opt_socks_proxy,
"Set socks4 proxy (host:port)"),
- OPT_WITHOUT_ARG("--submit-stale",
- opt_set_bool, &opt_submit_stale,
- "Submit shares even if they would normally be considered stale"),
#ifdef HAVE_SYSLOG_H
OPT_WITHOUT_ARG("--syslog",
opt_set_bool, &use_syslog,