diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-09-29 21:34:10 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-10 20:42:33 +0100 |
commit | b4c5180f2dc035bc2bf9615adff1e1b69ef09b89 (patch) | |
tree | c291d0723e94edc388efd88b14cb3fd1e6e94f3f /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #2406 (diff) | |
download | monero-b4c5180f2dc035bc2bf9615adff1e1b69ef09b89.tar.xz |
core: fix failure to sync when a tx is already in the pool
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 69d2edf65..d2a0c5a28 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2242,6 +2242,24 @@ bool Blockchain::get_tx_outputs_gindexs(const crypto::hash& tx_id, std::vector<u return true; } //------------------------------------------------------------------ +void Blockchain::on_new_tx_from_block(const cryptonote::transaction &tx) +{ +#if defined(PER_BLOCK_CHECKPOINT) + // check if we're doing per-block checkpointing + if (m_db->height() < 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<txin_to_key>(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 @@ -2257,19 +2275,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<txin_to_key>(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 |