Browse Source

Check for submit_stale before checking for work_restart

(to keep Kano happy)
nfactor-troky
Paul Sheppard 13 years ago
parent
commit
1ef52e0bac
  1. 2
      cgminer.c
  2. 20
      driver-bitforce.c

2
cgminer.c

@ -126,7 +126,7 @@ bool use_curses = true;
#else #else
bool use_curses; bool use_curses;
#endif #endif
static bool opt_submit_stale = true; bool opt_submit_stale = true;
static int opt_shares; static int opt_shares;
static bool opt_fail_only; static bool opt_fail_only;
bool opt_autofan; bool opt_autofan;

20
driver-bitforce.c

@ -343,20 +343,28 @@ static void biforce_thread_enable(struct thr_info *thr)
bitforce_init(bitforce); 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) static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce)
{ {
struct cgpu_info *bitforce = thr->cgpu; struct cgpu_info *bitforce = thr->cgpu;
bool submit_old = work->pool->submit_old;
bitforce->wait_ms = 0; bitforce->wait_ms = 0;
uint64_t ret; uint64_t ret;
if (ret = bitforce_send_work(thr, work)) { if (ret = bitforce_send_work(thr, work)) {
while (bitforce->wait_ms < bitforce->sleep_ms) { if(!opt_submit_stale || !submit_old) {
usleep(WORK_CHECK_INTERVAL_MS*1000); while (bitforce->wait_ms < bitforce->sleep_ms) {
bitforce->wait_ms += WORK_CHECK_INTERVAL_MS; usleep(WORK_CHECK_INTERVAL_MS*1000);
if (work_restart[thr->id].restart) { bitforce->wait_ms += WORK_CHECK_INTERVAL_MS;
applog(LOG_DEBUG, "BFL%i: Work restart, discarding after %dms", bitforce->device_id, bitforce->wait_ms); if (work_restart[thr->id].restart) {
return 1; //we have discarded all work; equivilent to 0 hashes done. 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;
} }
ret = bitforce_get_result(thr, work); ret = bitforce_get_result(thr, work);
} }

Loading…
Cancel
Save