From 4ea3f3da1a0c00ea74e85c31a22ea94d18bbdf06 Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Fri, 11 Dec 2009 16:49:21 +0000 Subject: retry IRC if name in use, resize to fit ubuntu's giant default font, scroll debug.log, pause gen during initial block download git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@44 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- db.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'db.cpp') diff --git a/db.cpp b/db.cpp index 947aed297..6fbd4b9c4 100644 --- a/db.cpp +++ b/db.cpp @@ -445,7 +445,7 @@ bool CAddrDB::LoadAddresses() CRITICAL_BLOCK(cs_mapAddresses) { // Load user provided addresses - CAutoFile filein = fopen("addr.txt", "rt"); + CAutoFile filein = fopen((GetDataDir() + "/addr.txt").c_str(), "rt"); if (filein) { try @@ -536,10 +536,11 @@ bool CReviewDB::WriteReviews(uint256 hash, const vector& vReviews) bool CWalletDB::LoadWallet(vector& vchDefaultKeyRet) { vchDefaultKeyRet.clear(); + int nFileVersion = 0; // Modify defaults #ifndef __WXMSW__ - // Reports that tray icon can disappear on gnome, leaving no way to access the program + // Tray icon sometimes disappears on 9.10 karmic koala 64-bit, leaving no way to access the program fMinimizeToTray = false; fMinimizeOnClose = false; #endif @@ -607,6 +608,10 @@ bool CWalletDB::LoadWallet(vector& vchDefaultKeyRet) { ssValue >> vchDefaultKeyRet; } + else if (strType == "version") + { + ssValue >> nFileVersion; + } else if (strType == "setting") { string strKey; @@ -649,6 +654,16 @@ bool CWalletDB::LoadWallet(vector& vchDefaultKeyRet) WriteSetting("nTransactionFee", nTransactionFee); } + // Upgrade + if (nFileVersion < VERSION) + { + // Get rid of old debug.log file in current directory + if (nFileVersion <= 105 && !pszSetDataDir[0]) + unlink("debug.log"); + + WriteVersion(VERSION); + } + return true; } @@ -656,7 +671,7 @@ bool LoadWallet(bool& fFirstRunRet) { fFirstRunRet = false; vector vchDefaultKey; - if (!CWalletDB("cr").LoadWallet(vchDefaultKey)) + if (!CWalletDB("cr+").LoadWallet(vchDefaultKey)) return false; fFirstRunRet = vchDefaultKey.empty(); -- cgit v1.2.3