Some adjustements

This commit is contained in:
MoneroOcean
2018-03-25 00:50:36 +01:00
parent df0a4c0cd6
commit 570cca0244
3 changed files with 11 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
#pragma once #pragma once
#define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0 #define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0
#define CURRENT_TRANSACTION_VERSION 2 #define CURRENT_TRANSACTION_VERSION 1
#define CURRENT_BLOCK_MAJOR_VERSION 1 #define CURRENT_BLOCK_MAJOR_VERSION 1
#define CURRENT_BLOCK_MINOR_VERSION 0 #define CURRENT_BLOCK_MINOR_VERSION 0
#define BLOCK_MAJOR_VERSION_1 1 #define BLOCK_MAJOR_VERSION_1 1
#define BLOCK_MAJOR_VERSION_2 3 #define BLOCK_MAJOR_VERSION_2 2
#define BLOCK_MAJOR_VERSION_3 3 #define BLOCK_MAJOR_VERSION_3 3
#define COIN ((uint64_t)100000000) // pow(10, 8) #define COIN ((uint64_t)100000000) // pow(10, 8)

View File

@@ -174,7 +174,10 @@ namespace cryptonote
BEGIN_SERIALIZE() BEGIN_SERIALIZE()
VARINT_FIELD(version) VARINT_FIELD(version)
if(CURRENT_TRANSACTION_VERSION < version) return false; if(CURRENT_TRANSACTION_VERSION < version) {
puts("!!! Too high tx version for serialization");
return false;
}
VARINT_FIELD(unlock_time) VARINT_FIELD(unlock_time)
FIELD(vin) FIELD(vin)
FIELD(vout) FIELD(vout)
@@ -408,7 +411,10 @@ namespace cryptonote
BEGIN_SERIALIZE_OBJECT() BEGIN_SERIALIZE_OBJECT()
VARINT_FIELD_N("major_version", b.major_version); VARINT_FIELD_N("major_version", b.major_version);
if(b.major_version > CURRENT_BYTECOIN_BLOCK_MAJOR_VERSION) return false; if(b.major_version > CURRENT_BYTECOIN_BLOCK_MAJOR_VERSION) {
puts("!!! Too high bytecoin version to serialize it");
return false;
}
VARINT_FIELD_N("minor_version", b.minor_version); VARINT_FIELD_N("minor_version", b.minor_version);
VARINT_FIELD(timestamp); VARINT_FIELD(timestamp);
FIELD_N("prev_id", b.prev_id); FIELD_N("prev_id", b.prev_id);

View File

@@ -956,7 +956,7 @@ namespace cryptonote
{ {
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_v2(bl, current_diffic, proof_of_work);
//case BLOCK_MAJOR_VERSION_3: return check_proof_of_work_v2(bl, current_diffic, proof_of_work); case BLOCK_MAJOR_VERSION_3: return check_proof_of_work_v2(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);