From c6375a14af768710561dc58c960444c76f879092 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 4 Sep 2017 09:23:38 +0100 Subject: [PATCH] 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. --- src/cryptonote_core/tx_pool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 543faa920..4b3fa787c 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -92,7 +92,7 @@ namespace cryptonote LockedTXN(Blockchain &b): m_blockchain(b), m_batch(false) { 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: Blockchain &m_blockchain; bool m_batch;