aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/berkeleydb
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-07-13 21:19:05 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-07-13 21:38:34 +0100
commitd7b681cd6518834ce9b76676980561cb8e235cff (patch)
tree51ff9d28bb4be6e929fd3440613932dbb039900c /src/blockchain_db/berkeleydb
parentMerge pull request #889 (diff)
downloadmonero-d7b681cd6518834ce9b76676980561cb8e235cff.tar.xz
remove hf_starting_height db
It's not really needed, it used to be an optimization for when that code was not using the db and needed to recalculate things fast on startup.
Diffstat (limited to 'src/blockchain_db/berkeleydb')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp28
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.h2
2 files changed, 0 insertions, 30 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index b11570e37..4d759d157 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -2186,34 +2186,6 @@ std::map<uint64_t, uint64_t>::BlockchainBDB::get_output_histogram(const std::vec
throw1(DB_ERROR("Not implemented."));
}
-void BlockchainBDB::set_hard_fork_starting_height(uint8_t version, uint64_t height)
-{
- LOG_PRINT_L3("BlockchainBDB::" << __func__);
- check_open();
-
- Dbt_copy<uint32_t> val_key(version + 1);
- Dbt_copy<uint64_t> val(height);
- if (m_hf_starting_heights->put(DB_DEFAULT_TX, &val_key, &val, 0))
- throw1(DB_ERROR("Error adding hard fork starting height to db transaction."));
-}
-
-uint64_t BlockchainBDB::get_hard_fork_starting_height(uint8_t version) const
-{
- LOG_PRINT_L3("BlockchainBDB::" << __func__);
- check_open();
-
- Dbt_copy<uint32_t> key(version + 1);
- Dbt_copy<uint64_t> result;
-
- auto get_result = m_hf_starting_heights->get(DB_DEFAULT_TX, &key, &result, 0);
- 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"));
-
- return result;
-}
-
void BlockchainBDB::check_hard_fork_info()
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
diff --git a/src/blockchain_db/berkeleydb/db_bdb.h b/src/blockchain_db/berkeleydb/db_bdb.h
index 5c6bda4eb..6bc26ed3d 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.h
+++ b/src/blockchain_db/berkeleydb/db_bdb.h
@@ -385,8 +385,6 @@ private:
virtual bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)> f) const;
// Hard fork related storage
- virtual void set_hard_fork_starting_height(uint8_t version, uint64_t height);
- virtual uint64_t get_hard_fork_starting_height(uint8_t version) const;
virtual void set_hard_fork_version(uint64_t height, uint8_t version);
virtual uint8_t get_hard_fork_version(uint64_t height) const;
virtual void check_hard_fork_info();