diff --git a/stratum/coind_template.cpp b/stratum/coind_template.cpp index b2f0fae..c39b86c 100644 --- a/stratum/coind_template.cpp +++ b/stratum/coind_template.cpp @@ -115,7 +115,6 @@ YAAMP_JOB_TEMPLATE *coind_create_template(YAAMP_COIND *coind) { coind_error(coind, "getblocktemplate result"); json_value_free(json); - return NULL; } @@ -124,7 +123,6 @@ YAAMP_JOB_TEMPLATE *coind_create_template(YAAMP_COIND *coind) { coind_error(coind, "getblocktemplate transactions"); json_value_free(json); - return NULL; } @@ -133,7 +131,6 @@ YAAMP_JOB_TEMPLATE *coind_create_template(YAAMP_COIND *coind) { coind_error(coind, "getblocktemplate coinbaseaux"); json_value_free(json); - return NULL; } @@ -204,6 +201,7 @@ YAAMP_JOB_TEMPLATE *coind_create_template(YAAMP_COIND *coind) templ->txmerkles[0] = 0; templ->txcount = txhashes.size(); templ->txsteps = merkle_steps(txhashes); + txhashes.clear(); vector::const_iterator i; for(i = templ->txsteps.begin(); i != templ->txsteps.end(); ++i) @@ -251,6 +249,10 @@ void coind_create_job(YAAMP_COIND *coind, bool force) strcmp(templ->coinb2, job_last->templ->coinb2) == 0) { // debuglog("coind_create_job %s %d same template %x \n", coind->name, coind->height, coind->job->id); + if (templ->txcount) { + templ->txsteps.clear(); + templ->txdata.clear(); + } delete templ; CommonUnlock(&coind->mutex); diff --git a/stratum/job.h b/stratum/job.h index ce09e6b..b77388c 100644 --- a/stratum/job.h +++ b/stratum/job.h @@ -73,6 +73,10 @@ public: inline void job_delete(YAAMP_OBJECT *object) { YAAMP_JOB *job = (YAAMP_JOB *)object; + if (job->templ->txcount) { + job->templ->txsteps.clear(); + job->templ->txdata.clear(); + } delete job->templ; delete job; } diff --git a/stratum/merkle.cpp b/stratum/merkle.cpp index 774ea1d..0779963 100644 --- a/stratum/merkle.cpp +++ b/stratum/merkle.cpp @@ -53,7 +53,7 @@ string merkle_with_first(vector steps, string f) sha256_double_hash_hex(bin, out, YAAMP_HASHLEN_BIN*2); f = out; - } + } return f; }