Merge pull request #26 from LBRYFoundation/Coolguy3289-stratum-debug

Update stratum // Adds debug code for console with regards to job submissions and updates blake2s headers for CPP 11+
This commit is contained in:
Ralph 2024-03-01 15:54:50 -05:00 committed by GitHub
commit a82d2b9372
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 675 additions and 670 deletions

View file

@ -323,20 +323,22 @@ void job_update()
// usleep(100*YAAMP_MS);
// int ready = 0;
// debuglog("job_update\n");
int ready = 0;
debuglog("job_update\n");
g_list_job.Enter();
for(CLI li = g_list_job.first; li; li = li->next)
{
debuglog("entered job CLI for loop\n");
YAAMP_JOB *job = (YAAMP_JOB *)li->data;
debuglog("Printing YAAMP_JOB *job value: ",job,"\n");
if(!job_can_mine(job)) continue;
debuglog("ready to broadcast job\n");
job_broadcast(job);
// ready++;
ready++;
}
// debuglog("job_update %d / %d jobs\n", ready, g_list_job.count);
debuglog("job_update %d / %d jobs\n", ready, g_list_job.count);
g_list_job.Leave();
}
@ -347,4 +349,3 @@ void job_update()

View file

@ -114,19 +114,24 @@ void job_unlock_clients(YAAMP_JOB *job)
bool job_can_mine(YAAMP_JOB *job)
{
if(job->deleted) return false;
if(job->remote)
return remote_can_mine(job->remote);
else if(job->coind)
return coind_can_mine(job->coind);
if(job->deleted) {
debuglog("Job was deleted\n");
return false;
}
if(job->remote) {
debuglog("job is remote?\n");
return remote_can_mine(job->remote);
}
else if(job->coind) {
debuglog("job is coind\n");
return coind_can_mine(job->coind);
} else {
debuglog("returning false for job_can_mine\n");
return false;
}
}

View file

@ -116,7 +116,7 @@ typedef struct __blake2s_param
uint8_t personal[BLAKE2S_PERSONALBYTES]; // 32
} blake2s_param;
ALIGN( 64 ) typedef struct __blake2s_state
typedef struct ALIGN( 64 ) __blake2s_state
{
uint32_t h[8];
uint32_t t[2];

View file

@ -479,4 +479,3 @@ void *stratum_thread(void *p)
pthread_detach(thread);
}
}