mirror of
https://github.com/monero-project/monero.git
synced 2024-12-28 06:09:23 -05:00
parent
240a50f3fb
commit
01c1512f22
@ -2349,9 +2349,9 @@ void BlockchainLMDB::block_txn_start(bool readonly)
|
|||||||
void BlockchainLMDB::block_txn_stop()
|
void BlockchainLMDB::block_txn_stop()
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||||
if (! m_batch_active)
|
if (m_write_txn && m_writer == boost::this_thread::get_id())
|
||||||
{
|
{
|
||||||
if (m_write_txn)
|
if (! m_batch_active)
|
||||||
{
|
{
|
||||||
TIME_MEASURE_START(time1);
|
TIME_MEASURE_START(time1);
|
||||||
m_write_txn->commit();
|
m_write_txn->commit();
|
||||||
@ -2362,25 +2362,26 @@ void BlockchainLMDB::block_txn_stop()
|
|||||||
m_write_txn = nullptr;
|
m_write_txn = nullptr;
|
||||||
memset(&m_wcursors, 0, sizeof(m_wcursors));
|
memset(&m_wcursors, 0, sizeof(m_wcursors));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (m_tinfo->m_ti_rtxn)
|
else if (m_tinfo->m_ti_rtxn)
|
||||||
{
|
{
|
||||||
mdb_txn_reset(m_tinfo->m_ti_rtxn);
|
mdb_txn_reset(m_tinfo->m_ti_rtxn);
|
||||||
memset(&m_tinfo->m_ti_rflags, 0, sizeof(m_tinfo->m_ti_rflags));
|
memset(&m_tinfo->m_ti_rflags, 0, sizeof(m_tinfo->m_ti_rflags));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockchainLMDB::block_txn_abort()
|
void BlockchainLMDB::block_txn_abort()
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||||
if (! m_batch_active)
|
if (m_write_txn && m_writer == boost::this_thread::get_id())
|
||||||
{
|
{
|
||||||
if (m_write_txn != nullptr)
|
if (! m_batch_active)
|
||||||
{
|
{
|
||||||
delete m_write_txn;
|
delete m_write_txn;
|
||||||
m_write_txn = nullptr;
|
m_write_txn = nullptr;
|
||||||
memset(&m_wcursors, 0, sizeof(m_wcursors));
|
memset(&m_wcursors, 0, sizeof(m_wcursors));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (m_tinfo->m_ti_rtxn)
|
else if (m_tinfo->m_ti_rtxn)
|
||||||
{
|
{
|
||||||
mdb_txn_reset(m_tinfo->m_ti_rtxn);
|
mdb_txn_reset(m_tinfo->m_ti_rtxn);
|
||||||
@ -2394,7 +2395,6 @@ void BlockchainLMDB::block_txn_abort()
|
|||||||
std::string(": block-level DB transaction abort called when write txn doesn't exist")
|
std::string(": block-level DB transaction abort called when write txn doesn't exist")
|
||||||
).c_str()));
|
).c_str()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t BlockchainLMDB::add_block(const block& blk, const size_t& block_size, const difficulty_type& cumulative_difficulty, const uint64_t& coins_generated,
|
uint64_t BlockchainLMDB::add_block(const block& blk, const size_t& block_size, const difficulty_type& cumulative_difficulty, const uint64_t& coins_generated,
|
||||||
|
Loading…
Reference in New Issue
Block a user