From 92467073adc11a76a26bbb55ccaed454169636f3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 4 Nov 2012 12:48:45 +0100 Subject: 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. --- src/db.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/db.cpp') diff --git a/src/db.cpp b/src/db.cpp index cf96fe6e38..fb405fc277 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -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++); } -- cgit v1.2.3