Update License in File Headers
[novacoin.git] / src / db.h
index 81f7a98..38daad3 100644 (file)
--- a/src/db.h
+++ b/src/db.h
@@ -1,7 +1,7 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
 // Copyright (c) 2009-2012 The Bitcoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
 #ifndef BITCOIN_DB_H
 #define BITCOIN_DB_H
 
@@ -34,7 +34,7 @@ void ThreadFlushWalletDB(void* parg);
 bool BackupWallet(const CWallet& wallet, const std::string& strDest);
 
 
-
+/** RAII class that provides access to a Berkeley database */
 class CDB
 {
 protected:
@@ -266,7 +266,7 @@ public:
 
 
 
-
+/** Access to the transaction database (blkindex.dat) */
 class CTxDB : public CDB
 {
 public:
@@ -297,7 +297,7 @@ public:
 
 
 
-
+/** Access to the (IP) address database (addr.dat) */
 class CAddrDB : public CDB
 {
 public:
@@ -306,16 +306,14 @@ private:
     CAddrDB(const CAddrDB&);
     void operator=(const CAddrDB&);
 public:
-    bool WriteAddress(const CAddress& addr);
-    bool EraseAddress(const CAddress& addr);
     bool WriteAddrman(const CAddrMan& addr);
-    bool LoadAddresses(bool &fUpdate);
+    bool LoadAddresses();
 };
 
 bool LoadAddresses();
 
 
-
+/** A key pool entry */
 class CKeyPool
 {
 public:
@@ -344,7 +342,7 @@ public:
 
 
 
-
+/** Error statuses for the wallet database */
 enum DBErrors
 {
     DB_LOAD_OK,
@@ -354,6 +352,7 @@ enum DBErrors
     DB_NEED_REWRITE
 };
 
+/** Access to the wallet database (wallet.dat) */
 class CWalletDB : public CDB
 {
 public:
@@ -475,18 +474,24 @@ public:
         return Erase(std::make_pair(std::string("pool"), nPool));
     }
 
+    // Settings are no longer stored in wallet.dat; these are
+    // used only for backwards compatibility:
     template<typename T>
     bool ReadSetting(const std::string& strKey, T& value)
     {
         return Read(std::make_pair(std::string("setting"), strKey), value);
     }
-
     template<typename T>
     bool WriteSetting(const std::string& strKey, const T& value)
     {
         nWalletDBUpdated++;
         return Write(std::make_pair(std::string("setting"), strKey), value);
     }
+    bool EraseSetting(const std::string& strKey)
+    {
+        nWalletDBUpdated++;
+        return Erase(std::make_pair(std::string("setting"), strKey));
+    }
 
     bool WriteMinVersion(int nVersion)
     {