|
@@ -871,7 +871,8 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
|
|
|
|
|
if (state->firstrun) {
|
|
if (state->firstrun) {
|
|
|
state->firstrun = false;
|
|
state->firstrun = false;
|
|
|
- memcpy(&state->last_work, work, sizeof(state->last_work));
|
|
|
|
|
|
|
+ clear_work(&state->last_work);
|
|
|
|
|
+ workcpy(&state->last_work, work);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -879,7 +880,8 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
|
|
|
|
|
// aborted before becoming idle, get new work
|
|
// aborted before becoming idle, get new work
|
|
|
if (ret == ICA_GETS_TIMEOUT || ret == ICA_GETS_RESTART) {
|
|
if (ret == ICA_GETS_TIMEOUT || ret == ICA_GETS_RESTART) {
|
|
|
- memcpy(&state->last_work, work, sizeof(state->last_work));
|
|
|
|
|
|
|
+ clear_work(&state->last_work);
|
|
|
|
|
+ workcpy(&state->last_work, work);
|
|
|
// ONLY up to just when it aborted
|
|
// ONLY up to just when it aborted
|
|
|
// We didn't read a reply so we don't subtract ICARUS_READ_TIME
|
|
// We didn't read a reply so we don't subtract ICARUS_READ_TIME
|
|
|
estimate_hashes = ((double)(elapsed.tv_sec)
|
|
estimate_hashes = ((double)(elapsed.tv_sec)
|
|
@@ -903,7 +905,8 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
curr_hw_errors = icarus->hw_errors;
|
|
curr_hw_errors = icarus->hw_errors;
|
|
|
submit_nonce(thr, &state->last_work, nonce);
|
|
submit_nonce(thr, &state->last_work, nonce);
|
|
|
was_hw_error = (curr_hw_errors > icarus->hw_errors);
|
|
was_hw_error = (curr_hw_errors > icarus->hw_errors);
|
|
|
- memcpy(&state->last_work, work, sizeof(state->last_work));
|
|
|
|
|
|
|
+ clear_work(&state->last_work);
|
|
|
|
|
+ workcpy(&state->last_work, work);
|
|
|
|
|
|
|
|
// Force a USB close/reopen on any hw error
|
|
// Force a USB close/reopen on any hw error
|
|
|
if (was_hw_error)
|
|
if (was_hw_error)
|