stratum: add method to free bm_job struct

This commit is contained in:
johnny9 2023-05-22 14:51:37 -04:00
parent 8cf78d58cc
commit 9c9c1ad540
3 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,8 @@ typedef struct {
char * extranonce2;
} bm_job;
void free_bm_job(bm_job * job);
char * construct_coinbase_tx(const char * coinbase_1, const char * coinbase_2,
const char * extranonce, const char * extranonce_2);

View File

@ -5,6 +5,13 @@
#include "utils.h"
#include "../../main/pretty.h"
void free_bm_job(bm_job * job)
{
free(job->jobid);
free(job->extranonce2);
free(job);
}
char * construct_coinbase_tx(const char * coinbase_1, const char * coinbase_2,
const char * extranonce, const char * extranonce_2)
{

View File

@ -98,6 +98,7 @@ static void AsicTask(void * pvParameters)
submit_share(sock, STRATUM_USER, next_bm_job->jobid,
next_bm_job->ntime, next_bm_job->extranonce2, nonce.nonce);
}
free_bm_job(next_bm_job);
}
}