diff options
author | Thomas Winget <tewinget@gmail.com> | 2015-02-22 18:06:44 -0500 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2015-02-22 18:06:44 -0500 |
commit | b7d112f601b9e6901c1785e378a72e5e6f866b1b (patch) | |
tree | 49699930e11ebdef02d9ea0109cfc2a1db175731 | |
parent | Bounds error, should fix #27 (diff) | |
parent | Fix Blockchain::get_tail_id() to set parameter to last block number instead o... (diff) | |
download | monero-b7d112f601b9e6901c1785e378a72e5e6f866b1b.tar.xz |
Merge pull request #31 from warptangent/fix/fix_get_tail_id
Fix Blockchain::get_tail_id() to set parameter to last block number instead of height
-rw-r--r-- | src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp | 2 | ||||
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp index ce568151c..4fa16b23e 100644 --- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp +++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp @@ -1053,7 +1053,7 @@ uint64_t BlockchainLMDB::height() const LOG_PRINT_L3("BlockchainLMDB::" << __func__); check_open(); - return m_height - 1; + return m_height; } diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index b671fa71a..525c7f36e 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -463,7 +463,7 @@ crypto::hash Blockchain::get_tail_id(uint64_t& height) const { LOG_PRINT_L3("Blockchain::" << __func__); CRITICAL_REGION_LOCAL(m_blockchain_lock); - height = m_db->height(); + height = m_db->height() - 1; return get_tail_id(); } //------------------------------------------------------------------ |