Add --submit-stale option which submits all shares, regardless of whether they would normally be considered stale.
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
diff --git a/main.c b/main.c
index dc97a9a..87d0892 100644
--- a/main.c
+++ b/main.c
@@ -208,6 +208,7 @@ static int mining_threads;
static int num_processors;
static int scan_intensity;
static bool use_curses = true;
+static bool opt_submit_stale;
#define QUIET (opt_quiet || opt_realquiet)
@@ -1088,6 +1089,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--scan-time|-s",
set_int_0_to_9999, opt_show_intval, &opt_scantime,
"Upper bound on time spent scanning current work, in seconds"),
+ OPT_WITHOUT_ARG("--submit-stale",
+ opt_set_bool, &opt_submit_stale,
+ "Submit shares even if they would normally be considered stale"),
OPT_WITH_ARG("--bench-algo|-b",
set_int_0_to_9999, opt_show_intval, &opt_bench_algo,
opt_hidden),
@@ -1832,7 +1836,7 @@ static void *submit_work_thread(void *userdata)
pthread_detach(pthread_self());
- if (stale_work(work)) {
+ if (!opt_submit_stale && stale_work(work)) {
applog(LOG_WARNING, "Stale share detected, discarding");
total_stale++;
pool->stale_shares++;
@@ -1841,7 +1845,7 @@ static void *submit_work_thread(void *userdata)
/* submit solution to bitcoin via JSON-RPC */
while (!submit_upstream_work(work)) {
- if (stale_work(work)) {
+ if (!opt_submit_stale && stale_work(work)) {
applog(LOG_WARNING, "Stale share detected, discarding");
total_stale++;
pool->stale_shares++;