Skip to content

Commit

Permalink
minor fixes to Blockchain.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tewinget authored and warptangent committed Jan 5, 2015
1 parent 74a1a89 commit 90f402e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ crypto::hash BlockchainLMDB::get_block_hash_from_height(const uint64_t& height)
if (get_result == MDB_NOTFOUND)
{
LOG_PRINT_L0("Attempted to get hash from height " << height << ", but no such hash exists");
throw DB_ERROR("Attempt to get hash from height failed -- block size not in db");
throw BLOCK_DNE("Attempt to get hash from height failed -- hash not in db");
}
else if (get_result)
{
Expand Down
8 changes: 6 additions & 2 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90f402e

Please sign in to comment.