|
|
@ -84,8 +84,11 @@ CDB::CDB(const char* pszFile, const char* pszMode) : pdb(NULL) |
|
|
|
string strErrorFile = strDataDir + "/db.log"; |
|
|
|
string strErrorFile = strDataDir + "/db.log"; |
|
|
|
printf("dbenv.open strLogDir=%s strErrorFile=%s\n", strLogDir.c_str(), strErrorFile.c_str()); |
|
|
|
printf("dbenv.open strLogDir=%s strErrorFile=%s\n", strLogDir.c_str(), strErrorFile.c_str()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nDbCache = GetArg("-dbcache", 25); |
|
|
|
dbenv.set_lg_dir(strLogDir.c_str()); |
|
|
|
dbenv.set_lg_dir(strLogDir.c_str()); |
|
|
|
dbenv.set_lg_max(10000000); |
|
|
|
dbenv.set_cachesize(nDbCache / 1024, (nDbCache % 1024)*1048576, 1); |
|
|
|
|
|
|
|
dbenv.set_lg_bsize(10485760); |
|
|
|
|
|
|
|
dbenv.set_lg_max(104857600); |
|
|
|
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(strErrorFile.c_str(), "a")); /// debug
|
|
|
|
dbenv.set_errfile(fopen(strErrorFile.c_str(), "a")); /// debug
|
|
|
@ -156,7 +159,7 @@ void CDB::Close() |
|
|
|
nMinutes = 1; |
|
|
|
nMinutes = 1; |
|
|
|
if (strFile == "addr.dat") |
|
|
|
if (strFile == "addr.dat") |
|
|
|
nMinutes = 2; |
|
|
|
nMinutes = 2; |
|
|
|
if (strFile == "blkindex.dat" && IsInitialBlockDownload() && nBestHeight % 500 != 0) |
|
|
|
if (strFile == "blkindex.dat" && IsInitialBlockDownload() && nBestHeight % 5000 != 0) |
|
|
|
nMinutes = 1; |
|
|
|
nMinutes = 1; |
|
|
|
dbenv.txn_checkpoint(0, nMinutes, 0); |
|
|
|
dbenv.txn_checkpoint(0, nMinutes, 0); |
|
|
|
|
|
|
|
|
|
|
|