mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 19:33:28 +01:00
minor fixes to Blockchain.cpp
This commit is contained in:
parent
74a1a89e27
commit
90f402e258
@ -1022,7 +1022,7 @@ crypto::hash BlockchainLMDB::get_block_hash_from_height(const uint64_t& height)
|
|||||||
if (get_result == MDB_NOTFOUND)
|
if (get_result == MDB_NOTFOUND)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L0("Attempted to get hash from height " << height << ", but no such hash exists");
|
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)
|
else if (get_result)
|
||||||
{
|
{
|
||||||
|
@ -1541,10 +1541,14 @@ void Blockchain::print_blockchain_index()
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
||||||
for(uint64_t i = 0; i <= m_db->height(); i++)
|
auto height = m_db->height();
|
||||||
|
if (height != 0)
|
||||||
|
{
|
||||||
|
for(uint64_t i = 0; i <= height; i++)
|
||||||
{
|
{
|
||||||
ss << "height: " << i << ", hash: " << m_db->get_block_hash_from_height(i);
|
ss << "height: " << i << ", hash: " << m_db->get_block_hash_from_height(i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LOG_PRINT_L0("Current blockchain index:" << std::endl
|
LOG_PRINT_L0("Current blockchain index:" << std::endl
|
||||||
<< ss.str()
|
<< ss.str()
|
||||||
|
Loading…
Reference in New Issue
Block a user