Moved LOKI hash to last phase of child block creation

This commit is contained in:
MoneroOcean
2019-04-03 12:01:40 -07:00
parent c93a411c64
commit c545b65f01

View File

@@ -302,6 +302,7 @@ NAN_METHOD(construct_mm_child_block_blob) { // (shareBuffer, blob_type, childBlo
block b = AUTO_VAL_INIT(b);
b.set_blob_type(blob_type);
if (!parse_and_validate_block_from_blob(block_template_blob, b)) return THROW_ERROR_EXCEPTION("construct_mm_child_block_blob: Failed to parse parent block");
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) b.miner_tx.version = cryptonote::loki_version_0;
block b2 = AUTO_VAL_INIT(b2);
b2.set_blob_type(BLOB_TYPE_FORKNOTE2);
@@ -334,8 +335,7 @@ NAN_METHOD(construct_mm_parent_block_blob) { // (parentBlockTemplate, blob_type,
block b = AUTO_VAL_INIT(b);
b.set_blob_type(blob_type);
if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse prent block");
if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) b.miner_tx.version = cryptonote::loki_version_0;
block b2 = AUTO_VAL_INIT(b2);
b2.set_blob_type(BLOB_TYPE_FORKNOTE2);
if (!parse_and_validate_block_from_blob(child_input, b2)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse child block");