mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Encapsulate BDB environment inside new CDBEnv class
Cleans up and organizes several scattered functions and variables related to the BDB env. Class CDBInit() existed to provide a guaranteed-via-C++-destructor cleanup of the db environment. A formal CDBEnv class provides all of this inside a single wrapper.
This commit is contained in:
parent
b52a270538
commit
cd9696fc97
4 changed files with 110 additions and 78 deletions
|
|
@ -54,9 +54,9 @@ void Shutdown(void* parg)
|
|||
{
|
||||
fShutdown = true;
|
||||
nTransactionsUpdated++;
|
||||
DBFlush(false);
|
||||
bitdb.Flush(false);
|
||||
StopNode();
|
||||
DBFlush(true);
|
||||
bitdb.Flush(true);
|
||||
boost::filesystem::remove(GetPidFile());
|
||||
UnregisterWallet(pwalletMain);
|
||||
delete pwalletMain;
|
||||
|
|
@ -294,7 +294,7 @@ bool AppInit2()
|
|||
}
|
||||
|
||||
fDebug = GetBoolArg("-debug");
|
||||
fDetachDB = GetBoolArg("-detachdb", false);
|
||||
bitdb.SetDetach(GetBoolArg("-detachdb", false));
|
||||
|
||||
#if !defined(WIN32) && !defined(QT_GUI)
|
||||
fDaemon = GetBoolArg("-daemon");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue