aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2014-12-11 19:36:27 +0000
committerwarptangent <warptangent@inbox.com>2015-01-04 19:39:42 -0800
commit1c578ad3f8ad57b291a4f651ef897120f7735b20 (patch)
tree8dfe3fa77c165619bc3aeb2523230cd2a32fbbeb /src
parentdb_lmdb: do not cast const away (diff)
downloadmonero-1c578ad3f8ad57b291a4f651ef897120f7735b20.tar.xz
db_lmdb: remove block timestamp too when removing a block
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
index 701b80a2c..3b4de0a62 100644
--- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
+++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
@@ -269,6 +269,12 @@ void BlockchainLMDB::remove_block()
throw DB_ERROR("Failed to add removal of block total generated coins to db transaction");
}
+ if (mdb_del(*m_write_txn, m_block_timestamps, &k, NULL))
+ {
+ LOG_PRINT_L1("Failed to add removal of block timestamp to db transaction");
+ throw DB_ERROR("Failed to add removal of block timestamp to db transaction");
+ }
+
if (mdb_del(*m_write_txn, m_block_heights, &h, NULL))
{
LOG_PRINT_L1("Failed to add removal of block height by hash to db transaction");