aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-11-10 21:12:46 -0500
committerLuke Dashjr <luke-jr+git@utopios.org>2011-11-15 10:11:53 -0500
commit2744ea8c1fbc2e1ef6b1824a21fd2a75e2b6dbc4 (patch)
tree215ae7f0e925c829d90e777d9aa452dfbc15f57f /src/init.cpp
parent00eae584a26295dbf7b1aebf99c1b8a4c9a86c37 (diff)
downloadbitcoin-2744ea8c1fbc2e1ef6b1824a21fd2a75e2b6dbc4.tar.xz
Obsolete keypool and make sure database removes log files on shutdown.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp
index dbc2c41332..4a149b31bf 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -34,8 +34,8 @@ void Shutdown(void* parg)
{
static CCriticalSection cs_Shutdown;
static bool fTaken;
- bool fFirstThread;
- CRITICAL_BLOCK(cs_Shutdown)
+ bool fFirstThread = false;
+ TRY_CRITICAL_BLOCK(cs_Shutdown)
{
fFirstThread = !fTaken;
fTaken = true;
@@ -45,9 +45,9 @@ void Shutdown(void* parg)
{
fShutdown = true;
nTransactionsUpdated++;
- DBFlush(false);
+ DBFlush(false, false);
StopNode();
- DBFlush(true);
+ DBFlush(true, true);
boost::filesystem::remove(GetPidFile());
UnregisterWallet(pwalletMain);
delete pwalletMain;
@@ -396,6 +396,12 @@ bool AppInit2(int argc, char* argv[])
strErrors += _("Error loading wallet.dat: Wallet corrupted \n");
else if (nLoadWalletRet == DB_TOO_NEW)
strErrors += _("Error loading wallet.dat: Wallet requires newer version of Bitcoin \n");
+ else if (nLoadWalletRet == DB_NEED_REWRITE)
+ {
+ strErrors += _("Wallet needed to be rewritten: restart Bitcoin to complete \n");
+ wxMessageBox(strErrors, "Bitcoin", wxOK | wxICON_ERROR);
+ return false;
+ }
else
strErrors += _("Error loading wallet.dat \n");
}