Skip to content

Commit

Permalink
Assess if BM1366 has returned a valid job result
Browse files Browse the repository at this point in the history
  • Loading branch information
SatsForFreedom committed Sep 8, 2023
1 parent f9ad1eb commit 1a41c25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/bm1397/bm1366.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,11 @@ task_result *BM1366_proccess_work(void *pvParameters)

GlobalState *GLOBAL_STATE = (GlobalState *)pvParameters;

if (GLOBAL_STATE->valid_jobs[rx_job_id] == 0) {
ESP_LOGE(TAG, "Invalid job nonce found, id=%d", rx_job_id);
return NULL;
}

uint32_t rolled_version = GLOBAL_STATE->ASIC_TASK_MODULE.active_jobs[rx_job_id]->version;

// // // shift the 16 bit value left 13
Expand Down

0 comments on commit 1a41c25

Please sign in to comment.