Update CWallet::LoadWallet for proper return type.
authorJeff Garzik <jeff@garzik.org>
Wed, 13 Jul 2011 05:07:49 +0000 (01:07 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 13 Jul 2011 05:07:49 +0000 (01:07 -0400)
src/db.h
src/wallet.cpp
src/wallet.h

index bd8254f..049857b 100644 (file)
--- a/src/db.h
+++ b/src/db.h
@@ -346,7 +346,8 @@ enum DBErrors
 {
     DB_LOAD_OK,
     DB_CORRUPT,
-    DB_TOO_NEW
+    DB_TOO_NEW,
+    DB_LOAD_FAIL,
 };
 
 class CWalletDB : public CDB
index f4df5ec..a60b0b4 100644 (file)
@@ -1122,7 +1122,7 @@ string CWallet::SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWall
 
 
 
-bool CWallet::LoadWallet(bool& fFirstRunRet)
+int CWallet::LoadWallet(bool& fFirstRunRet)
 {
     if (!fFileBacked)
         return false;
@@ -1139,11 +1139,11 @@ bool CWallet::LoadWallet(bool& fFirstRunRet)
 
         SetDefaultKey(GetOrReuseKeyFromPool());
         if (!SetAddressBookName(PubKeyToAddress(vchDefaultKey), ""))
-            return false;
+            return DB_LOAD_FAIL;
     }
 
     CreateThread(ThreadFlushWalletDB, &strWalletFile);
-    return true;
+    return DB_LOAD_OK;
 }
 
 
index d336d38..c19b3f4 100644 (file)
@@ -167,7 +167,7 @@ public:
         walletdb.WriteBestBlock(loc);
     }
 
-    bool LoadWallet(bool& fFirstRunRet);
+    int LoadWallet(bool& fFirstRunRet);
 //    bool BackupWallet(const std::string& strDest);
 
     // requires cs_mapAddressBook lock