summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index 6dbd2454a4..dd0ed5cbaf 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -299,13 +299,10 @@ void CDbxMDBX::SetCacheSafetyMode(BOOL bIsSet)
MDBX_txn* CDbxMDBX::StartTran()
{
- if (m_bReadOnly)
- return nullptr;
-
mir_cslock lck(m_csDbAccess);
if (m_pWriteTran == nullptr) {
- m_dbError = mdbx_txn_begin(m_env, nullptr, MDBX_TXN_READWRITE, &m_pWriteTran);
+ m_dbError = mdbx_txn_begin(m_env, nullptr, (m_bReadOnly) ? MDBX_TXN_RDONLY : MDBX_TXN_READWRITE, &m_pWriteTran);
// FIXME: throw an exception
_ASSERT(m_dbError == MDBX_SUCCESS);
}