diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 7c808b28..066fe761 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -6093,6 +6093,14 @@ bool blockchain_storage::prevalidate_block(const block& bl) else return false; } + //after hard_fork3 and before hard_fork4 + else if (m_core_runtime_config.is_hardfork_active_for_height(3, block_height) && + !m_core_runtime_config.is_hardfork_active_for_height(4, block_height)) + { + if (bl.major_version != HF3_BLOCK_MAJOR_VERSION) + return false; + } + //after hard_fork3 if (bl.major_version > CURRENT_BLOCK_MAJOR_VERSION) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index 86aa8549..97c0412f 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -1798,7 +1798,7 @@ namespace currency bool r = false; for (size_t i = 0; i != sources.size(); i++) { - const tx_source_entry& source_entry = sources[inputs_mapping[i] + input_starter_index]; + const tx_source_entry& source_entry = sources[inputs_mapping[i]]; crypto::hash tx_hash_for_signature = prepare_prefix_hash_for_sign(tx, i + input_starter_index, tx_prefix_hash); CHECK_AND_ASSERT_MES(tx_hash_for_signature != null_hash, false, "prepare_prefix_hash_for_sign failed"); std::stringstream ss_ring_s; diff --git a/src/currency_core/currency_format_utils_transactions.cpp b/src/currency_core/currency_format_utils_transactions.cpp index 33012294..3f8d6873 100644 --- a/src/currency_core/currency_format_utils_transactions.cpp +++ b/src/currency_core/currency_format_utils_transactions.cpp @@ -287,6 +287,10 @@ namespace currency //--------------------------------------------------------------- bool validate_inputs_sorting(const transaction& tx) { + if (get_tx_flags(tx) & TX_FLAG_SIGNATURE_MODE_SEPARATE) + return true; + + size_t i = 0; for(; i+1 < tx.vin.size(); i++) { diff --git a/tests/core_tests/block_validation.cpp b/tests/core_tests/block_validation.cpp index 94d615a4..c7d55c21 100644 --- a/tests/core_tests/block_validation.cpp +++ b/tests/core_tests/block_validation.cpp @@ -693,11 +693,11 @@ bool gen_block_wrong_version_agains_hardfork::c1(currency::core& c, size_t ev_in r = mine_next_pow_block_in_playtime(mining_accunt.get_public_address(), c, cb); // block with height 4 (won't pass) CHECK_TEST_CONDITION(!r); - //major lower then norma for hf3 (do we need this half-working backward compability) + //major lower then normal for hf3 (do we need this half-working backward compability? nope, hardfork 3 always put HF3_BLOCK_MAJOR_VERSION in major version ) major_version_to_set = 0; minor_version_to_set = 0; r = mine_next_pow_block_in_playtime(mining_accunt.get_public_address(), c, cb); // block with height 4 (won't pass) - CHECK_TEST_CONDITION(r); + CHECK_TEST_CONDITION(!r); return true; }