Merge branch '0.5.x' into cbvalue_zero

This commit is contained in:
Luke Dashjr
2018-02-17 17:59:01 +00:00

View File

@@ -170,20 +170,19 @@ static int64_t blktxn_set_gentx_weight(struct blktxn_t * const gentx) {
}
uint64_t blkmk_init_generation3(blktemplate_t * const tmpl, const void * const script, const size_t scriptsz, bool * const inout_newcb) {
if (tmpl->cbtxn && !(*inout_newcb && (tmpl->mutations & BMM_GENERATE)))
const bool replace_existing = *inout_newcb;
*inout_newcb = false;
if (tmpl->cbtxn && !(replace_existing && (tmpl->mutations & BMM_GENERATE)))
{
*inout_newcb = false;
return 0;
}
if (!tmpl->cbvalue) {
// TODO: Figure it out from the existing cbtxn
*inout_newcb = false;
return 0;
}
*inout_newcb = true;
if (scriptsz >= 0xfd)
return 0;
@@ -280,6 +279,7 @@ uint64_t blkmk_init_generation3(blktemplate_t * const tmpl, const void * const s
tmpl->mutations |= BMM_CBAPPEND | BMM_CBSET | BMM_GENERATE;
*inout_newcb = true;
return tmpl->cbvalue;
}