aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-05-19 12:33:19 -0700
committerJeff Garzik <jgarzik@exmulti.com>2012-05-19 12:33:19 -0700
commitcde87ee75cd95b076259e146705bf34b66cd83aa (patch)
tree8e61cc927eac363907d749e1943bcca2c57b0644
parentbd795bd5436841c759fc5a9c900f68852bba0e6c (diff)
parent394b9298faec503f3780645ed17fa00cce6da2dd (diff)
Merge pull request #1360 from jgarzik/datasync
Default to DB_TXN_WRITE_NOSYNC for all transactional operations
-rw-r--r--src/db.cpp1
-rw-r--r--src/db.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/db.cpp b/src/db.cpp
index cbcbd3faa0..50f0891626 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -96,6 +96,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL)
dbenv.set_lk_max_locks(10000);
dbenv.set_lk_max_objects(10000);
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.log_set_config(DB_LOG_AUTO_REMOVE, 1);
ret = dbenv.open(pathDataDir.string().c_str(),
diff --git a/src/db.h b/src/db.h
index 9cec267e98..0ff06e40a8 100644
--- a/src/db.h
+++ b/src/db.h
@@ -216,7 +216,7 @@ public:
if (!pdb)
return false;
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)
return false;
vTxn.push_back(ptxn);