Revert "Check for submit_stale before checking for work_restart" Makes no sense to continue working on the old block whether submit_stale is enabled or not.
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/cgminer.c b/cgminer.c
index 31b5820..d9e6cd0 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -125,7 +125,7 @@ bool use_curses = true;
#else
bool use_curses;
#endif
-bool opt_submit_stale = true;
+static bool opt_submit_stale = true;
static int opt_shares;
static bool opt_fail_only;
bool opt_autofan;
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 0a47df5..29d27c9 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -353,29 +353,21 @@ static void biforce_thread_enable(struct thr_info *thr)
bitforce_init(bitforce);
}
-extern bool opt_submit_stale;
-
static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce)
{
struct cgpu_info *bitforce = thr->cgpu;
- bool submit_old = work->pool->submit_old;
bitforce->wait_ms = 0;
uint64_t ret;
ret = bitforce_send_work(thr, work);
- if(!opt_submit_stale || !submit_old) {
- while (bitforce->wait_ms < bitforce->sleep_ms) {
- usleep(WORK_CHECK_INTERVAL_MS*1000);
- bitforce->wait_ms += WORK_CHECK_INTERVAL_MS;
- if (work_restart[thr->id].restart) {
- applog(LOG_DEBUG, "BFL%i: Work restart, discarding after %dms", bitforce->device_id, bitforce->wait_ms);
- return 1; //we have discarded all work; equivalent to 0 hashes done.
- }
+ while (bitforce->wait_ms < bitforce->sleep_ms) {
+ usleep(WORK_CHECK_INTERVAL_MS*1000);
+ bitforce->wait_ms += WORK_CHECK_INTERVAL_MS;
+ if (work_restart[thr->id].restart) {
+ applog(LOG_DEBUG, "BFL%i: Work restart, discarding after %dms", bitforce->device_id, bitforce->wait_ms);
+ return 1; //we have discarded all work; equivilent to 0 hashes done.
}
- } else {
- usleep(bitforce->sleep_ms*1000);
- bitforce->wait_ms = bitforce->sleep_ms;
}
if (ret)