mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Merge pull request #1360 from jgarzik/datasync
Default to DB_TXN_WRITE_NOSYNC for all transactional operations
This commit is contained in:
commit
cde87ee75c
@ -96,6 +96,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL)
|
|||||||
dbenv.set_lk_max_locks(10000);
|
dbenv.set_lk_max_locks(10000);
|
||||||
dbenv.set_lk_max_objects(10000);
|
dbenv.set_lk_max_objects(10000);
|
||||||
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
|
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
|
||||||
|
dbenv.set_flags(DB_TXN_WRITE_NOSYNC, 1);
|
||||||
dbenv.set_flags(DB_AUTO_COMMIT, 1);
|
dbenv.set_flags(DB_AUTO_COMMIT, 1);
|
||||||
dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
|
dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
|
||||||
ret = dbenv.open(pathDataDir.string().c_str(),
|
ret = dbenv.open(pathDataDir.string().c_str(),
|
||||||
|
2
src/db.h
2
src/db.h
@ -216,7 +216,7 @@ public:
|
|||||||
if (!pdb)
|
if (!pdb)
|
||||||
return false;
|
return false;
|
||||||
DbTxn* ptxn = NULL;
|
DbTxn* ptxn = NULL;
|
||||||
int ret = dbenv.txn_begin(GetTxn(), &ptxn, DB_TXN_NOSYNC);
|
int ret = dbenv.txn_begin(GetTxn(), &ptxn, DB_TXN_WRITE_NOSYNC);
|
||||||
if (!ptxn || ret != 0)
|
if (!ptxn || ret != 0)
|
||||||
return false;
|
return false;
|
||||||
vTxn.push_back(ptxn);
|
vTxn.push_back(ptxn);
|
||||||
|
Loading…
Reference in New Issue
Block a user