aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb
diff options
context:
space:
mode:
authorwarptangent <warptangent@tutanota.com>2016-02-04 17:15:37 -0800
committerwarptangent <warptangent@tutanota.com>2016-02-08 08:50:47 -0800
commitc657e772c4efbfee8ff698883f1532a38117a70a (patch)
treefe161e761bea2845fa35a9758978a6a20f333cfc /src/blockchain_db/lmdb
parentblockchain_import: Add exception to log output (diff)
downloadmonero-c657e772c4efbfee8ff698883f1532a38117a70a.tar.xz
blockchain_import: Add --drop-hard-fork command
Diffstat (limited to 'src/blockchain_db/lmdb')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp13
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index c18db7724..541e838f7 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -2457,6 +2457,19 @@ void BlockchainLMDB::check_hard_fork_info()
TXN_POSTFIX_SUCCESS();
}
+void BlockchainLMDB::drop_hard_fork_info()
+{
+ LOG_PRINT_L3("BlockchainLMDB::" << __func__);
+ check_open();
+
+ TXN_PREFIX(0);
+
+ mdb_drop(*txn_ptr, m_hf_starting_heights, 1);
+ mdb_drop(*txn_ptr, m_hf_versions, 1);
+
+ TXN_POSTFIX_SUCCESS();
+}
+
void BlockchainLMDB::set_hard_fork_starting_height(uint8_t version, uint64_t height)
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h
index 48f4adb41..eb0704ab2 100644
--- a/src/blockchain_db/lmdb/db_lmdb.h
+++ b/src/blockchain_db/lmdb/db_lmdb.h
@@ -236,6 +236,7 @@ private:
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();
+ virtual void drop_hard_fork_info();
/**
* @brief convert a tx output to a blob for storage