tx_pool: catch exceptions in LockedTXN dtor

This might prevent some calls to terminate when the LockedTXN
dtor is called as part of stack unwinding caused by another
exception in the first place.
This commit is contained in:
moneromooo-monero
2017-09-04 09:23:38 +01:00
parent 02e5dcd2fa
commit dbfef643ed

View File

@@ -92,7 +92,7 @@ namespace cryptonote
LockedTXN(Blockchain &b): m_blockchain(b), m_batch(false) { LockedTXN(Blockchain &b): m_blockchain(b), m_batch(false) {
m_batch = m_blockchain.get_db().batch_start(); m_batch = m_blockchain.get_db().batch_start();
} }
~LockedTXN() { if (m_batch) { m_blockchain.get_db().batch_stop(); } } ~LockedTXN() { try { if (m_batch) { m_blockchain.get_db().batch_stop(); } } catch (const std::exception &e) { MWARNING("LockedTXN dtor filtering exception: " << e.what()); } }
private: private:
Blockchain &m_blockchain; Blockchain &m_blockchain;
bool m_batch; bool m_batch;