bool get_block_longhash(cn_context &context, const Block& b, Hash& res) { BinaryArray bd; if (b.majorVersion == BLOCK_MAJOR_VERSION_1 || b.majorVersion >= BLOCK_MAJOR_VERSION_4) { if (!get_block_hashing_blob(b, bd)) { return false; } } else if (b.majorVersion == BLOCK_MAJOR_VERSION_2 || b.majorVersion == BLOCK_MAJOR_VERSION_3) { if (!get_parent_block_hashing_blob(b, bd)) { return false; } } else { return false; } cn_slow_hash(context, bd.data(), bd.size(), res); return true; }
bool get_block_longhash(crypto::cn_context &context, const Block& b, crypto::hash& res) { blobdata bd; if (b.majorVersion == BLOCK_MAJOR_VERSION_1) { if (!get_block_hashing_blob(b, bd)) { return false; } } else if (b.majorVersion == BLOCK_MAJOR_VERSION_2) { if (!get_parent_block_hashing_blob(b, bd)) { return false; } } else { return false; } crypto::cn_slow_hash(context, bd.data(), bd.size(), res); return true; }