stratum: add logs in coind_create_job()

This commit is contained in:
Tzu-Jung Lee 2022-07-28 12:06:45 -04:00 committed by Roy Lee
parent ce5d2d3030
commit 26a976e0ae
2 changed files with 12 additions and 4 deletions

View file

@ -304,9 +304,15 @@ bool client_update_block(YAAMP_CLIENT *client, json_value *json_params)
}
int coinid = json_params->u.array.values[1]->u.integer;
if(!coinid) return false;
if(!coinid) {
debuglog("client_update_block(): object_find() coin id failed\n");
return false;
}
YAAMP_COIND *coind = (YAAMP_COIND *)object_find(&g_list_coind, coinid, true);
if(!coind) return false;
if(!coind) {
debuglog("client_update_block(): can't find coind for coinid:%d\n", coinid);
return false;
}
const char* hash = json_params->u.array.values[2]->u.string.ptr;

View file

@ -523,10 +523,12 @@ bool coind_create_job(YAAMP_COIND *coind, bool force)
if(!templ)
{
CommonUnlock(&coind->mutex);
// debuglog("%s: create job template failed!\n", coind->symbol);
stratumlog("%s: create job template failed!\n", coind->symbol);
return false;
}
stratumlog("templ->height: %d, coind->height: %d\n", templ->height, coind->height);
YAAMP_JOB *job_last = coind->job;
if( !force && job_last && job_last->templ && job_last->templ->created + 45 > time(NULL) &&
@ -592,7 +594,7 @@ bool coind_create_job(YAAMP_COIND *coind, bool force)
g_list_job.AddTail(coind->job);
CommonUnlock(&coind->mutex);
// debuglog("coind_create_job %s %d new job %x\n", coind->name, coind->height, coind->job->id);
debuglog("coind_create_job %s %d new job %x\n", coind->name, coind->height, coind->job->id);
return true;
}