|
|
@@ -125,6 +125,7 @@ int opt_log_interval = 5;
|
|
|
int opt_queue = 1;
|
|
|
int opt_scantime = 60;
|
|
|
int opt_expiry = 120;
|
|
|
+int opt_expiry_lp = 3600;
|
|
|
int opt_bench_algo = -1;
|
|
|
static const bool opt_time = true;
|
|
|
unsigned long long global_hashrate;
|
|
|
@@ -1063,7 +1064,10 @@ static struct opt_table opt_config_table[] = {
|
|
|
#endif
|
|
|
OPT_WITH_ARG("--expiry|-E",
|
|
|
set_int_0_to_9999, opt_show_intval, &opt_expiry,
|
|
|
- "Upper bound on how many seconds after getting work we consider a share from it stale"),
|
|
|
+ "Upper bound on how many seconds after getting work we consider a share from it stale (w/o longpoll active)"),
|
|
|
+ OPT_WITH_ARG("--expiry-lp",
|
|
|
+ set_int_0_to_9999, opt_show_intval, &opt_expiry_lp,
|
|
|
+ "Upper bound on how many seconds after getting work we consider a share from it stale (with longpoll active)"),
|
|
|
OPT_WITHOUT_ARG("--failover-only",
|
|
|
opt_set_bool, &opt_fail_only,
|
|
|
"Don't leak work to backup pools when primary pool is lagging"),
|
|
|
@@ -3209,11 +3213,15 @@ static bool stale_work(struct work *work, bool share)
|
|
|
/* Technically the rolltime should be correct but some pools
|
|
|
* advertise a broken expire= that is lower than a meaningful
|
|
|
* scantime */
|
|
|
- if (work->rolltime > opt_scantime)
|
|
|
+ if (work->rolltime >= opt_scantime)
|
|
|
work_expiry = work->rolltime;
|
|
|
else
|
|
|
work_expiry = opt_expiry;
|
|
|
|
|
|
+ int max_expiry = (have_longpoll ? opt_expiry_lp : opt_expiry);
|
|
|
+ if (work_expiry > max_expiry)
|
|
|
+ work_expiry = max_expiry;
|
|
|
+
|
|
|
if (share) {
|
|
|
/* If the share isn't on this pool's latest block, it's stale */
|
|
|
if (pool->block_id && pool->block_id != block_id)
|