Remove -detachdb and stop's detach argument.

As the only BDB database left is the wallet, and it is always
detached.

Also remove IsChainFile() predicate and related chainfile-specific
logic.
This commit is contained in:
Pieter Wuille
2012-11-04 12:48:45 +01:00
parent a56d3f8a10
commit 92467073ad
9 changed files with 6 additions and 52 deletions

View File

@@ -271,14 +271,6 @@ CDB::CDB(const char *pszFile, const char* pszMode) :
}
}
static bool IsChainFile(std::string strFile)
{
if (strFile == "coins.dat" || strFile == "blktree.dat")
return true;
return false;
}
void CDB::Flush()
{
if (activeTxn)
@@ -288,10 +280,6 @@ void CDB::Flush()
unsigned int nMinutes = 0;
if (fReadOnly)
nMinutes = 1;
if (IsChainFile(strFile))
nMinutes = 2;
if (IsChainFile(strFile) && IsInitialBlockDownload())
nMinutes = 5;
bitdb.dbenv.txn_checkpoint(nMinutes ? GetArg("-dblogsize", 100)*1024 : 0, nMinutes, 0);
}
@@ -453,11 +441,9 @@ void CDBEnv::Flush(bool fShutdown)
CloseDb(strFile);
printf("%s checkpoint\n", strFile.c_str());
dbenv.txn_checkpoint(0, 0, 0);
if (!IsChainFile(strFile) || fDetachDB) {
printf("%s detach\n", strFile.c_str());
if (!fMockDb)
dbenv.lsn_reset(strFile.c_str(), 0);
}
printf("%s detach\n", strFile.c_str());
if (!fMockDb)
dbenv.lsn_reset(strFile.c_str(), 0);
printf("%s closed\n", strFile.c_str());
mapFileUseCount.erase(mi++);
}