diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 0d71a151..31b607ca 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -471,6 +471,7 @@ bool blockchain_storage::init(const std::string& config_folder, const boost::pro LOG_PRINT_L0("In the blockchain hash for the block 3076401 is " << h << " while it is expected to be " << b3076401_id << ". Most likely recent blocks are alternative and invalid for the current hardfork, thus we truncate the blockchain, so that block 3076400 becomes new top block..."); truncate_blockchain(ZANO_HARDFORK_05_AFTER_HEIGHT + 1); + m_tx_pool.clear(); } } else diff --git a/src/currency_core/tx_pool.cpp b/src/currency_core/tx_pool.cpp index d076d147..4c98db89 100644 --- a/src/currency_core/tx_pool.cpp +++ b/src/currency_core/tx_pool.cpp @@ -238,18 +238,21 @@ namespace currency } TIME_MEASURE_FINISH_PD(check_inputs_time); - if (tx.version > TRANSACTION_VERSION_PRE_HF4) + if (!from_core) { - TIME_MEASURE_START_PD(check_post_hf4_balance); - r = check_tx_balance(tx, id); - CHECK_AND_ASSERT_MES_CUSTOM(r, false, { tvc.m_verification_failed = true; }, "post-HF4 tx: balance proof is invalid"); - TIME_MEASURE_FINISH_PD(check_post_hf4_balance); + if (tx.version > TRANSACTION_VERSION_PRE_HF4) + { + TIME_MEASURE_START_PD(check_post_hf4_balance); + r = check_tx_balance(tx, id); + CHECK_AND_ASSERT_MES_CUSTOM(r, false, { tvc.m_verification_failed = true; }, "post-HF4 tx: balance proof is invalid"); + TIME_MEASURE_FINISH_PD(check_post_hf4_balance); - r = process_type_in_variant_container_and_make_sure_its_unique(tx.extra, [&](const asset_descriptor_operation& ado){ + r = process_type_in_variant_container_and_make_sure_its_unique(tx.extra, [&](const asset_descriptor_operation& ado) { asset_op_verification_context avc = { tx, id, ado }; return m_blockchain.validate_asset_operation(avc, m_blockchain.get_current_blockchain_size()); - }, true); - CHECK_AND_ASSERT_MES_CUSTOM(r, false, { tvc.m_verification_failed = true; }, "post-HF4 tx: asset operation is invalid"); + }, true); + CHECK_AND_ASSERT_MES_CUSTOM(r, false, { tvc.m_verification_failed = true; }, "post-HF4 tx: asset operation is invalid"); + } } do_insert_transaction(tx, id, blob_size, kept_by_block, tx_fee, ch_inp_res ? max_used_block_id : null_hash, ch_inp_res ? max_used_block_height : 0);