mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 17:32:33 +00:00
db_lmdb: do not keep a dangling pointer to stack objects
This commit is contained in:
parent
29b5876ad1
commit
1d23db220a
1 changed files with 4 additions and 0 deletions
|
@ -1804,12 +1804,14 @@ uint64_t BlockchainLMDB::add_block( const block& blk
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BlockchainDB::add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
|
BlockchainDB::add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
|
||||||
|
m_write_txn = NULL;
|
||||||
|
|
||||||
txn.commit();
|
txn.commit();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
m_num_outputs = num_outputs;
|
m_num_outputs = num_outputs;
|
||||||
|
m_write_txn = NULL;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1830,12 +1832,14 @@ void BlockchainLMDB::pop_block(block& blk, std::vector<transaction>& txs)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BlockchainDB::pop_block(blk, txs);
|
BlockchainDB::pop_block(blk, txs);
|
||||||
|
m_write_txn = NULL;
|
||||||
|
|
||||||
txn.commit();
|
txn.commit();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
m_num_outputs = num_outputs;
|
m_num_outputs = num_outputs;
|
||||||
|
m_write_txn = NULL;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue