more fixes since xmr hardfork version increased

forknote_comp
clintar 2016-03-24 03:18:20 -06:00
parent 0a259628ad
commit 15d682bfb6
2 changed files with 16 additions and 16 deletions

View File

@ -479,11 +479,11 @@ namespace cryptonote
BEGIN_SERIALIZE_OBJECT() BEGIN_SERIALIZE_OBJECT()
FIELDS(*static_cast<block_header *>(this)) FIELDS(*static_cast<block_header *>(this))
if (BLOCK_MAJOR_VERSION_2 <= major_version) // if (BLOCK_MAJOR_VERSION_2 <= major_version)
{ // {
auto sbb = make_serializable_bytecoin_block(*this, false, false); // auto sbb = make_serializable_bytecoin_block(*this, false, false);
FIELD_N("parent_block", sbb); // FIELD_N("parent_block", sbb);
} // }
FIELD(miner_tx) FIELD(miner_tx)
FIELD(tx_hashes) FIELD(tx_hashes)
END_SERIALIZE() END_SERIALIZE()

View File

@ -650,15 +650,15 @@ namespace cryptonote
if (!get_block_hashing_blob(b, blob)) if (!get_block_hashing_blob(b, blob))
return false; return false;
if (BLOCK_MAJOR_VERSION_2 <= b.major_version) // if (BLOCK_MAJOR_VERSION_2 <= b.major_version)
{ // {
blobdata parent_blob; // blobdata parent_blob;
auto sbb = make_serializable_bytecoin_block(b, true, false); // auto sbb = make_serializable_bytecoin_block(b, true, false);
if (!t_serializable_object_to_blob(sbb, parent_blob)) // if (!t_serializable_object_to_blob(sbb, parent_blob))
return false; // return false;
blob.append(parent_blob); // blob.append(parent_blob);
} // }
return get_object_hash(blob, res); return get_object_hash(blob, res);
} }
@ -851,8 +851,8 @@ namespace cryptonote
//--------------------------------------------------------------- //---------------------------------------------------------------
bool check_proof_of_work_v1(const block& bl, difficulty_type current_diffic, crypto::hash& proof_of_work) bool check_proof_of_work_v1(const block& bl, difficulty_type current_diffic, crypto::hash& proof_of_work)
{ {
if (BLOCK_MAJOR_VERSION_1 != bl.major_version) // if (BLOCK_MAJOR_VERSION_1 != bl.major_version)
return false; // return false;
proof_of_work = get_block_longhash(bl, 0); proof_of_work = get_block_longhash(bl, 0);
return check_hash(proof_of_work, current_diffic); return check_hash(proof_of_work, current_diffic);
@ -899,7 +899,7 @@ namespace cryptonote
switch (bl.major_version) switch (bl.major_version)
{ {
case BLOCK_MAJOR_VERSION_1: return check_proof_of_work_v1(bl, current_diffic, proof_of_work); case BLOCK_MAJOR_VERSION_1: return check_proof_of_work_v1(bl, current_diffic, proof_of_work);
case BLOCK_MAJOR_VERSION_2: return check_proof_of_work_v2(bl, current_diffic, proof_of_work); case BLOCK_MAJOR_VERSION_2: return check_proof_of_work_v1(bl, current_diffic, proof_of_work);
} }
CHECK_AND_ASSERT_MES(false, false, "unknown block major version: " << bl.major_version << "." << bl.minor_version); CHECK_AND_ASSERT_MES(false, false, "unknown block major version: " << bl.major_version << "." << bl.minor_version);