Don't try to get bitforce temperature if we're polling for a result to minimise the chance of interleaved responses.
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
diff --git a/driver-bitforce.c b/driver-bitforce.c
index bf7c039..ca6b8b0 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -347,6 +347,11 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
if (!fdDev)
return false;
+ /* Do not try to get the temperature if we're polling for a result to
+ * minimise the change of interleaved results */
+ if (bitforce->polling)
+ return true;
+
/* It is not critical getting temperature so don't get stuck if we
* can't grab the mutex here */
if (mutex_trylock(&bitforce->device_mutex))
@@ -627,9 +632,11 @@ static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_
bitforce->wait_ms = sleep_time;
}
- if (send_ret)
+ if (send_ret) {
+ bitforce->polling = true;
ret = bitforce_get_result(thr, work);
- else
+ bitforce->polling = false;
+ } else
ret = -1;
if (ret == -1) {
diff --git a/miner.h b/miner.h
index 26d628b..f87612a 100644
--- a/miner.h
+++ b/miner.h
@@ -329,6 +329,7 @@ struct cgpu_info {
unsigned int avg_wait_d;
uint32_t nonces;
bool nonce_range;
+ bool polling;
#endif
pthread_mutex_t device_mutex;