From 8912cad28be4f858d711416e5bdfbe61ad287765 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 1 May 2018 22:45:18 +0200 Subject: [PATCH] Possible fix 2 --- src/cryptonote_core/cryptonote_basic.h | 17 ++++++++--------- src/main.cc | 6 +++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index 21c148a..60d5db9 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -165,21 +165,21 @@ namespace cryptonote class transaction: public transaction_prefix { - enum BLOB_TYPE m_blob_type; public: + enum BLOB_TYPE blob_type; std::vector > signatures; //count signatures always the same as inputs count rct::rctSig rct_signatures; - transaction(enum BLOB_TYPE = BLOB_TYPE_CRYPTONOTE); + transaction(); virtual ~transaction(); void set_null(); BEGIN_SERIALIZE_OBJECT() FIELDS(*static_cast(this)) - if (version == 1 && m_blob_type != BLOB_TYPE_CRYPTONOTE2) + if (version == 1 && blob_type != BLOB_TYPE_CRYPTONOTE2) { - printf("%i\n", m_blob_type); + printf("%i\n", blob_type); puts("xxx1"); ar.tag("signatures"); ar.begin_array(); @@ -238,10 +238,9 @@ namespace cryptonote }; inline - transaction::transaction(enum BLOB_TYPE blob_type) + transaction::transaction() { set_null(); - m_blob_type = blob_type; } inline @@ -279,7 +278,7 @@ namespace cryptonote /* */ /************************************************************************/ - const uint8_t CURRENT_BYTECOIN_BLOCK_MAJOR_VERSION = 1; + /*const uint8_t CURRENT_BYTECOIN_BLOCK_MAJOR_VERSION = 1; struct bytecoin_block { @@ -367,7 +366,7 @@ namespace cryptonote }; // Implemented below - inline serializable_bytecoin_block make_serializable_bytecoin_block(const block& b, bool hashing_serialization, bool header_only); + inline serializable_bytecoin_block make_serializable_bytecoin_block(const block& b, bool hashing_serialization, bool header_only);*/ struct block_header { @@ -395,7 +394,7 @@ namespace cryptonote transaction miner_tx; std::vector tx_hashes; - block() : miner_tx(blob_type) {} + void set_blob_type(enum BLOB_TYPE bt) { miner_tx.blob_type = blob_type = bt; } BEGIN_SERIALIZE_OBJECT() FIELDS(*static_cast(this)) diff --git a/src/main.cc b/src/main.cc index 0598a6f..e11989f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -87,7 +87,7 @@ NAN_METHOD(convert_blob) { //convert block b = AUTO_VAL_INIT(b); - b.blob_type = blob_type; + b.set_blob_type(blob_type); if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("Failed to parse block"); if (blob_type == BLOB_TYPE_FORKNOTE2) { @@ -118,7 +118,7 @@ NAN_METHOD(get_block_id) { } block b = AUTO_VAL_INIT(b); - b.blob_type = blob_type; + b.set_blob_type(blob_type); if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("Failed to parse block"); crypto::hash block_id; @@ -149,7 +149,7 @@ NAN_METHOD(construct_block_blob) { } block b = AUTO_VAL_INIT(b); - b.blob_type = blob_type; + b.set_blob_type(blob_type); if (!parse_and_validate_block_from_blob(block_template_blob, b)) return THROW_ERROR_EXCEPTION("Failed to parse block"); b.nonce = nonce;