aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/berkeleydb/db_bdb.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-10-25 10:40:13 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-10-25 12:35:59 +0000
commit50dfdc057a071ac8e64bc6b2b56b5b228a61b349 (patch)
treec7f9da75f4ccb8b72c8b7a59f5817a3934f14309 /src/blockchain_db/berkeleydb/db_bdb.cpp
parentblockchain_db: use the DNE exceptions where appropriate (diff)
downloadmonero-50dfdc057a071ac8e64bc6b2b56b5b228a61b349.tar.xz
db_bdb: DB_KEYEMPTY is also not found for non-top recon fields
Diffstat (limited to '')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index 06a87c39b..11c8cc8a4 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -1880,7 +1880,7 @@ uint64_t BlockchainBDB::get_hard_fork_starting_height(uint8_t version) const
Dbt_copy<uint64_t> result;
auto get_result = m_hf_starting_heights->get(DB_DEFAULT_TX, &key, &result, 0);
- if (get_result == DB_NOTFOUND)
+ if (get_result == DB_NOTFOUND || get_result == DB_KEYEMPTY)
return std::numeric_limits<uint64_t>::max();
else if (get_result)
throw0(DB_ERROR("Error attempting to retrieve hard fork starting height from the db"));
@@ -1908,7 +1908,7 @@ uint8_t BlockchainBDB::get_hard_fork_version(uint64_t height) const
Dbt_copy<uint8_t> result;
auto get_result = m_hf_versions->get(DB_DEFAULT_TX, &key, &result, 0);
- if (get_result == DB_NOTFOUND)
+ if (get_result == DB_NOTFOUND || get_result == DB_KEYEMPTY)
throw0(OUTPUT_DNE("Error attempting to retrieve hard fork version from the db"));
else if (get_result)
throw0(DB_ERROR("Error attempting to retrieve hard fork version from the db"));