mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Merge pull request #1367 from jgarzik/db-private
BDB: restore DB_PRIVATE flag to environment
This commit is contained in:
commit
ce4cc630c2
@ -76,6 +76,10 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL)
|
|||||||
if (fCreate)
|
if (fCreate)
|
||||||
nFlags |= DB_CREATE;
|
nFlags |= DB_CREATE;
|
||||||
|
|
||||||
|
unsigned int nEnvFlags = 0;
|
||||||
|
if (GetBoolArg("-privdb", true))
|
||||||
|
nEnvFlags |= DB_PRIVATE;
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK(cs_db);
|
LOCK(cs_db);
|
||||||
if (!fDbEnvInit)
|
if (!fDbEnvInit)
|
||||||
@ -106,7 +110,8 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL)
|
|||||||
DB_INIT_MPOOL |
|
DB_INIT_MPOOL |
|
||||||
DB_INIT_TXN |
|
DB_INIT_TXN |
|
||||||
DB_THREAD |
|
DB_THREAD |
|
||||||
DB_RECOVER,
|
DB_RECOVER |
|
||||||
|
nEnvFlags,
|
||||||
S_IRUSR | S_IWUSR);
|
S_IRUSR | S_IWUSR);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
throw runtime_error(strprintf("CDB() : error %d opening database environment", ret));
|
throw runtime_error(strprintf("CDB() : error %d opening database environment", ret));
|
||||||
|
Loading…
Reference in New Issue
Block a user