Better wording for transaction fee notification messages
[novacoin.git] / db.h
diff --git a/db.h b/db.h
index df48699..290981c 100644 (file)
--- a/db.h
+++ b/db.h
@@ -13,6 +13,7 @@ class CAddress;
 class CWalletTx;
 class CAccount;
 class CAccountingEntry;
+class CBlockLocator;
 
 extern map<string, string> mapAddressBook;
 extern CCriticalSection cs_mapAddressBook;
@@ -26,6 +27,8 @@ extern DbEnv dbenv;
 
 
 extern void DBFlush(bool fShutdown);
+extern vector<unsigned char> GetKeyFromKeyPool();
+extern int64 GetOldestKeyPoolTime();
 
 
 
@@ -263,7 +266,7 @@ public:
 class CTxDB : public CDB
 {
 public:
-    CTxDB(const char* pszMode="r+") : CDB(!fClient ? "blkindex.dat" : NULL, pszMode) { }
+    CTxDB(const char* pszMode="r+") : CDB("blkindex.dat", pszMode) { }
 private:
     CTxDB(const CTxDB&);
     void operator=(const CTxDB&);
@@ -403,6 +406,17 @@ public:
         return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
     }
 
+    bool WriteBestBlock(const CBlockLocator& locator)
+    {
+        nWalletDBUpdated++;
+        return Write(string("bestblock"), locator);
+    }
+
+    bool ReadBestBlock(CBlockLocator& locator)
+    {
+        return Read(string("bestblock"), locator);
+    }
+
     bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
     {
         vchPubKey.clear();
@@ -431,8 +445,9 @@ public:
 
     bool ReadAccount(const string& strAccount, CAccount& account);
     bool WriteAccount(const string& strAccount, const CAccount& account);
-    bool WriteAccountingEntry(const string& strAccount, const CAccountingEntry& acentry);
+    bool WriteAccountingEntry(const CAccountingEntry& acentry);
     int64 GetAccountCreditDebit(const string& strAccount);
+    void ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& acentries);
 
     bool LoadWallet();
 protected:
@@ -440,9 +455,8 @@ protected:
     void KeepKey(int64 nIndex);
     static void ReturnKey(int64 nIndex);
     friend class CReserveKey;
-public:
-    vector<unsigned char> GetKeyFromKeyPool();
-    int64 GetOldestKeyPoolTime();
+    friend vector<unsigned char> GetKeyFromKeyPool();
+    friend int64 GetOldestKeyPoolTime();
 };
 
 bool LoadWallet(bool& fFirstRunRet);