diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-10-28 13:43:50 -0400 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-01-04 19:31:19 -0800 |
commit | 90f402e258d6ec8b0bb27e78be013af5ba463953 (patch) | |
tree | c6351fa0284b30b9a739431dfe2cb78c532cf72c /src/cryptonote_core/blockchain.cpp | |
parent | Integrate BlockchainDB into cryptonote_core (diff) | |
download | monero-90f402e258d6ec8b0bb27e78be013af5ba463953.tar.xz |
minor fixes to Blockchain.cpp
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 0f5765281..25d1ae33c 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1541,9 +1541,13 @@ void Blockchain::print_blockchain_index() { std::stringstream ss; CRITICAL_REGION_LOCAL(m_blockchain_lock); - for(uint64_t i = 0; i <= m_db->height(); i++) + auto height = m_db->height(); + if (height != 0) { - ss << "height: " << i << ", hash: " << m_db->get_block_hash_from_height(i); + for(uint64_t i = 0; i <= height; i++) + { + ss << "height: " << i << ", hash: " << m_db->get_block_hash_from_height(i); + } } LOG_PRINT_L0("Current blockchain index:" << std::endl |