diff --git a/stratum/client.cpp b/stratum/client.cpp index 3c2bd94..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; @@ -319,8 +325,9 @@ bool client_update_block(YAAMP_CLIENT *client, json_value *json_params) coind->newblock = true; coind->notreportingcounter = 0; - if (!strcmp("DCR", coind->rpcencoding)) { - usleep(300*YAAMP_MS); + if (!strcmp("DCR", coind->rpcencoding) || !strcmp("LBC", coind->rpcencoding)) + { + usleep(300 * YAAMP_MS); } block_confirm(coind->id, hash); diff --git a/stratum/client_submit.cpp b/stratum/client_submit.cpp index 054f83f..fc48ffe 100644 --- a/stratum/client_submit.cpp +++ b/stratum/client_submit.cpp @@ -281,8 +281,8 @@ static void client_do_submit(YAAMP_CLIENT *client, YAAMP_JOB *job, YAAMP_JOB_VAL target_to_diff(coin_target), target_to_diff(hash_int), hash1, submitvalues->hash_be, templ->has_segwit_txs); - if(!strcmp("DCR", coind->rpcencoding)) { - // delay between dcrd and dcrwallet + if(!strcmp("DCR", coind->rpcencoding) ||!strcmp("LBC", coind->rpcencoding)) { + // delay between dcrd/lbcd and dcrwallet/lbcwallet sleep(1); } diff --git a/stratum/coinbase.cpp b/stratum/coinbase.cpp index 86b31eb..3e25d40 100644 --- a/stratum/coinbase.cpp +++ b/stratum/coinbase.cpp @@ -97,7 +97,7 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value * char script1[4*1024]; sprintf(script1, "%s%s%s08", eheight, templ->flags, etime); - char script2[32] = "7969696d7000"; // "yiimp\0" in hex ascii + char script2[32] = "2f6c627279706f6f6c2e6e65742f"; // "/lbrypool.net/" in hex ascii if(!coind->pos && !coind->isaux && templ->auxs_size) coinbase_aux(templ, script2); diff --git a/stratum/coind_template.cpp b/stratum/coind_template.cpp index 7109038..66905d6 100644 --- a/stratum/coind_template.cpp +++ b/stratum/coind_template.cpp @@ -239,8 +239,8 @@ YAAMP_JOB_TEMPLATE *coind_create_template(YAAMP_COIND *coind) json_value *json = rpc_call(&coind->rpc, "getblocktemplate", params); if(!json || json_is_null(json)) { - // coind_error() reset auto_ready, and DCR gbt can fail - if (strcmp(coind->rpcencoding, "DCR") == 0) + // coind_error() reset auto_ready, and DCR/LBC gbt can fail + if (!strcmp(coind->rpcencoding, "DCR") || !strcmp(coind->rpcencoding, "LBC")) debuglog("decred getblocktemplate failed\n"); else coind_error(coind, "getblocktemplate"); @@ -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; } diff --git a/web/images/coin-flax.png b/web/images/coin-flax.png index d28eaf3..21b6948 100644 Binary files a/web/images/coin-flax.png and b/web/images/coin-flax.png differ