From 69ce33f2175eb0692846e18572608fa25c41976e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 29 Sep 2017 21:34:10 +0100 Subject: core: fix failure to sync when a tx is already in the pool --- src/cryptonote_core/blockchain.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/cryptonote_core/blockchain.cpp') diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 0b09d503c..c5c2d22d0 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2292,6 +2292,24 @@ bool Blockchain::get_tx_outputs_gindexs(const crypto::hash& tx_id, std::vectorheight() < m_blocks_hash_check.size()) + { + TIME_MEASURE_START(a); + m_blocks_txs_check.push_back(get_transaction_hash(tx)); + TIME_MEASURE_FINISH(a); + if(m_show_time_stats) + { + size_t ring_size = tx.vin[0].type() == typeid(txin_to_key) ? boost::get(tx.vin[0]).key_offsets.size() : 0; + MINFO("HASH: " << "-" << " I/M/O: " << tx.vin.size() << "/" << ring_size << "/" << tx.vout.size() << " H: " << 0 << " chcktx: " << a); + } + } +#endif +} +//------------------------------------------------------------------ //FIXME: it seems this function is meant to be merely a wrapper around // another function of the same name, this one adding one bit of // functionality. Should probably move anything more than that @@ -2307,19 +2325,10 @@ bool Blockchain::check_tx_inputs(transaction& tx, uint64_t& max_used_block_heigh #if defined(PER_BLOCK_CHECKPOINT) // check if we're doing per-block checkpointing - // FIXME: investigate why this block returns if (m_db->height() < m_blocks_hash_check.size() && kept_by_block) { - TIME_MEASURE_START(a); - m_blocks_txs_check.push_back(get_transaction_hash(tx)); max_used_block_id = null_hash; max_used_block_height = 0; - TIME_MEASURE_FINISH(a); - if(m_show_time_stats) - { - size_t ring_size = tx.vin[0].type() == typeid(txin_to_key) ? boost::get(tx.vin[0]).key_offsets.size() : 0; - MINFO("HASH: " << "-" << " I/M/O: " << tx.vin.size() << "/" << ring_size << "/" << tx.vout.size() << " H: " << 0 << " chcktx: " << a); - } return true; } #endif -- cgit v1.2.3