From 26a976e0aecb2fe2d1ee222873cd84803f2081c0 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Thu, 28 Jul 2022 12:06:45 -0400 Subject: [PATCH] stratum: add logs in coind_create_job() --- stratum/client.cpp | 10 ++++++++-- stratum/coind_template.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/stratum/client.cpp b/stratum/client.cpp index bfc9c32..84f5f2e 100644 --- a/stratum/client.cpp +++ b/stratum/client.cpp @@ -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; diff --git a/stratum/coind_template.cpp b/stratum/coind_template.cpp index c65e104..66905d6 100644 --- a/stratum/coind_template.cpp +++ b/stratum/coind_template.cpp @@ -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; }