diff options
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbmodulechain.cpp')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbmodulechain.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Dbx_mdbx/src/dbmodulechain.cpp b/plugins/Dbx_mdbx/src/dbmodulechain.cpp index b9b29b4c5a..b5f3546309 100644 --- a/plugins/Dbx_mdbx/src/dbmodulechain.cpp +++ b/plugins/Dbx_mdbx/src/dbmodulechain.cpp @@ -43,13 +43,14 @@ uint32_t CDbxMDBX::GetModuleID(const char *szName) uint32_t iHash = mir_hashstr(szName);
if (m_Modules.find(iHash) == m_Modules.end()) {
MDBX_val key = { &iHash, sizeof(iHash) }, data = { (void*)szName, strlen(szName) + 1 };
-
- for (;; Remap()) {
+ {
txn_ptr txn(m_env);
- MDBX_CHECK(mdbx_put(txn, m_dbModules, &key, &data, 0), -1);
- if (txn.commit() == MDBX_SUCCESS)
- break;
+ if (mdbx_put(txn, m_dbModules, &key, &data, 0) != MDBX_SUCCESS)
+ return -1;
+ if (txn.commit() != MDBX_SUCCESS)
+ return -1;
}
+
m_Modules[iHash] = szName;
}
|