1
0
Fork 0
forked from lthn/blockchain

fixed mdbx issues with with new version

This commit is contained in:
cryptozoidberg 2021-11-16 14:58:19 +01:00
parent 8d8ec50ae7
commit f53b696798
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -143,9 +143,10 @@ namespace tools
else
{
int res = 0;
unsigned int flags = 0;
MDBX_txn_flags_t flags = MDBX_txn_flags_t();
unsigned int flags_ = 0;
if (read_only)
flags += MDBX_RDONLY;
flags = MDBX_TXN_RDONLY;
//don't use parent tx in write transactions if parent tx was read-only (restriction in mdbx)
//see "Nested transactions: Max 1 child, write txns only, no writemap"
@ -340,7 +341,8 @@ namespace tools
data[0].iov_base = (void*)v;
data[0].iov_len = vs;
res = mdbx_put(get_current_tx(), static_cast<MDBX_dbi>(h), &key, data, 0);
MDBX_put_flags_t flags = MDBX_put_flags_t();
res = mdbx_put(get_current_tx(), static_cast<MDBX_dbi>(h), &key, data, flags);
CHECK_AND_ASSERT_MESS_MDBX_DB(res, false, "Unable to mdbx_put");
return true;
}