admin: only abandon work if there is work to abandon

This commit is contained in:
johnny9 2023-05-27 09:47:18 -04:00
parent 96217bc9a7
commit 474f98d070

View File

@ -230,7 +230,7 @@ static void admin_task(void *pvParameters)
stratum_method method = parse_stratum_method(line);
if (method == MINING_NOTIFY) {
if (should_abandon_work(line)) {
if (should_abandon_work(line) && g_queue.count > 0) {
ESP_LOGI(TAG, "Should abandon work, clearing queues");
abandon_work = 1;
queue_clear(&g_queue);