From ba384294b5cd98b9552804cab063ea78f3b74cf1 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 9 Jun 2023 08:08:37 -0400 Subject: [PATCH] comments --- components/stratum/stratum_api.c | 14 ++++++++++++++ main/tasks/asic_task.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/components/stratum/stratum_api.c b/components/stratum/stratum_api.c index 529abc0a..bcd25431 100644 --- a/components/stratum/stratum_api.c +++ b/components/stratum/stratum_api.c @@ -1,3 +1,9 @@ +/****************************************************************************** + * * + * References: + * 1. Stratum Protocol - [link](https://reference.cash/mining/stratum-protocol) + *****************************************************************************/ + #include "stratum_api.h" #include "cJSON.h" #include @@ -292,6 +298,14 @@ int STRATUM_V1_authenticate(int socket, const char * username) return 1; } + +/// @param socket Socket to write to +/// @param username The client’s user name. +/// @param jobid The job ID for the work being submitted. +/// @param ntime The hex-encoded time value use in the block header. +/// @param extranonce_2 The hex-encoded value of extra nonce 2. +/// @param nonce The hex-encoded nonce value to use in the block header. + void STRATUM_V1_submit_share(int socket, const char * username, const char * jobid, const uint32_t ntime, const char * extranonce_2, const uint32_t nonce) { diff --git a/main/tasks/asic_task.c b/main/tasks/asic_task.c index 0caf5586..b5af23c7 100644 --- a/main/tasks/asic_task.c +++ b/main/tasks/asic_task.c @@ -50,6 +50,8 @@ void ASIC_task(void * pvParameters) struct job_packet job; // max job number is 128 + // there is still some really weird logic with the job id bits for the asic to sort out + // so we have it limited to 128 and it has to increment by 4 id = (id + 4) % 128; job.job_id = id; job.num_midstates = 1;