aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2014-12-07 11:36:44 +0000
committerwarptangent <warptangent@inbox.com>2015-01-04 19:39:41 -0800
commit1d23db220ad584b3af1cc243cd3a1193bb1deeed (patch)
tree3a5b49c831caa1a69e15f3bb5dee16b9b46774c5 /src/cryptonote_core
parentdb_lmdb: make cursor internal members private (diff)
downloadmonero-1d23db220ad584b3af1cc243cd3a1193bb1deeed.tar.xz
db_lmdb: do not keep a dangling pointer to stack objects
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
index 632c2cc60..278bec14f 100644
--- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
+++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
@@ -1804,12 +1804,14 @@ uint64_t BlockchainLMDB::add_block( const block& blk
try
{
BlockchainDB::add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
+ m_write_txn = NULL;
txn.commit();
}
catch (...)
{
m_num_outputs = num_outputs;
+ m_write_txn = NULL;
throw;
}
@@ -1830,12 +1832,14 @@ void BlockchainLMDB::pop_block(block& blk, std::vector<transaction>& txs)
try
{
BlockchainDB::pop_block(blk, txs);
+ m_write_txn = NULL;
txn.commit();
}
catch (...)
{
m_num_outputs = num_outputs;
+ m_write_txn = NULL;
throw;
}