diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-08-15 18:44:56 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-08-15 18:44:56 +0100 |
commit | 73d42a75d4e441ff0a3d536beedfa3adb82479d8 (patch) | |
tree | eab6ecde82bc6af6130068058bba3993c39ea4a3 | |
parent | blockchain: remove dead code (diff) | |
download | monero-73d42a75d4e441ff0a3d536beedfa3adb82479d8.tar.xz |
blockchain: update cumulative size after block addition
Block addition can fail, and the old code would not update the
cumulative size in that case.
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 4d1eecfc1..695be9f4e 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2480,8 +2480,6 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash& if(m_db->height()) cumulative_difficulty += m_db->get_block_cumulative_difficulty(m_db->height() - 1); - update_next_cumulative_size_limit(); - TIME_MEASURE_FINISH(block_processing_time); if(precomputed) block_processing_time += m_fake_pow_calc_time; @@ -2521,6 +2519,8 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash& TIME_MEASURE_FINISH(addblock); + update_next_cumulative_size_limit(); + LOG_PRINT_L1("+++++ BLOCK SUCCESSFULLY ADDED" << std::endl << "id:\t" << id << std::endl << "PoW:\t" << proof_of_work << std::endl << "HEIGHT " << new_height << ", difficulty:\t" << current_diffic << std::endl << "block reward: " << print_money(fee_summary + base_reward) << "(" << print_money(base_reward) << " + " << print_money(fee_summary) << "), coinbase_blob_size: " << coinbase_blob_size << ", cumulative size: " << cumulative_block_size << ", " << block_processing_time << "(" << target_calculating_time << "/" << longhash_calculating_time << ")ms"); if(m_show_time_stats) { |