diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 3db594ca..f88d60c6 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2213,31 +2213,6 @@ bool blockchain_storage::is_multisig_output_spent(const crypto::hash& multisig_i return source_tx_ptr->m_spent_flags[ms_out_index]; } //------------------------------------------------------------------ -// bool blockchain_storage::resync_spent_tx_flags() -// { -// LOG_PRINT_L0("Started re-building spent tx outputs data..."); -// CRITICAL_REGION_LOCAL(m_blockchain_lock); -// for(auto& tx: m_db_transactions) -// { -// if(is_coinbase(tx.second.tx)) -// continue; -// -// for(auto& in: tx.second.tx.vin) -// { -// CHECKED_GET_SPECIFIC_VARIANT(in, txin_to_key, in_to_key, false); -// if(in_to_key.key_offsets.size() != 1) -// continue; -// -// //direct spending -// if(!update_spent_tx_flags_for_input(in_to_key.amount, in_to_key.key_offsets[0], true)) -// return false; -// -// } -// } -// LOG_PRINT_L0("Finished re-building spent tx outputs data"); -// return true; -// } -//------------------------------------------------------------------ bool blockchain_storage::find_blockchain_supplement(const std::list& qblock_ids, uint64_t& starter_offset)const { CRITICAL_REGION_LOCAL(m_read_lock); diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index b281e5c3..e4eebf74 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -258,6 +258,11 @@ namespace currency } //pre-validate block here, and propagate it to network asap to avoid latency of handling big block (tx flood) + //######################################################## + /* + problem with prevalidation: in case of pre_validate_block() is passed but handle_incoming_tx() is failed + network got spammed with notifications about this broken block and then connections got closed. + temporary disabled to more investigation bool prevalidate_relayed = false; if (m_core.pre_validate_block(b, bvc, block_id) && bvc.m_added_to_main_chain) { @@ -266,6 +271,8 @@ namespace currency relay_block(arg, context); prevalidate_relayed = true; } + */ + //######################################################## //now actually process block for(auto tx_blob_it = arg.b.txs.begin(); tx_blob_it!=arg.b.txs.end();tx_blob_it++) @@ -291,13 +298,13 @@ namespace currency } LOG_PRINT_GREEN("[HANDLE]NOTIFY_NEW_BLOCK EXTRA: id: " << block_id << ",bvc.m_added_to_main_chain " << bvc.m_added_to_main_chain - << ",prevalidate_result " << prevalidate_relayed + //<< ",prevalidate_result " << prevalidate_relayed << ",bvc.added_to_altchain " << bvc.added_to_altchain << ",bvc.m_marked_as_orphaned " << bvc.m_marked_as_orphaned, LOG_LEVEL_2); if (bvc.m_added_to_main_chain || (bvc.added_to_altchain && bvc.height_difference < 2)) { - if (!prevalidate_relayed) + if (true/*!prevalidate_relayed*/) { // pre-validation failed prevoiusly, but complete check was success, not an alternative block ++arg.hop; diff --git a/src/version.h.in b/src/version.h.in index 8522d942..e523598c 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -2,6 +2,6 @@ #define BUILD_COMMIT_ID "@VERSION@" #define PROJECT_VERSION "1.0" -#define PROJECT_VERSION_BUILD_NO 28 +#define PROJECT_VERSION_BUILD_NO 29 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"