diff options
author | Jeff Garzik <jgarzik@exmulti.com> | 2012-05-21 09:40:30 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@exmulti.com> | 2012-05-21 09:40:30 -0700 |
commit | ce4cc630c278c51e384a24dc26d1fe0b08df27b0 (patch) | |
tree | cb8c99e82e31cf022425906ef80ff44f893cad90 | |
parent | 46784d0826df00d218d25a1e3df419bef36d70ce (diff) | |
parent | 9c137aaccf8900138f40fc9fecbc00b11828223a (diff) |
Merge pull request #1367 from jgarzik/db-private
BDB: restore DB_PRIVATE flag to environment
-rw-r--r-- | src/db.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/db.cpp b/src/db.cpp index 90442f77f2..a0b9dc20f7 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -76,6 +76,10 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL) if (fCreate) nFlags |= DB_CREATE; + unsigned int nEnvFlags = 0; + if (GetBoolArg("-privdb", true)) + nEnvFlags |= DB_PRIVATE; + { LOCK(cs_db); if (!fDbEnvInit) @@ -106,7 +110,8 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL) DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | - DB_RECOVER, + DB_RECOVER | + nEnvFlags, S_IRUSR | S_IWUSR); if (ret > 0) throw runtime_error(strprintf("CDB() : error %d opening database environment", ret)); |