stratum: cover LBC with DCR tricks

This commit is contained in:
Roy Lee 2022-09-29 09:30:49 -07:00
parent 4cb3e7ed16
commit ce5d2d3030
3 changed files with 7 additions and 6 deletions

View file

@ -319,7 +319,8 @@ bool client_update_block(YAAMP_CLIENT *client, json_value *json_params)
coind->newblock = true;
coind->notreportingcounter = 0;
if (!strcmp("DCR", coind->rpcencoding)) {
if (!strcmp("DCR", coind->rpcencoding) || !strcmp("LBC", coind->rpcencoding))
{
usleep(300 * YAAMP_MS);
}

View file

@ -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);
}

View file

@ -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");