Update CMakeLists.txt - play with openssl
[novacoin.git] / src / db.h
index 993b7a7..d04bd2d 100644 (file)
--- a/src/db.h
+++ b/src/db.h
@@ -5,7 +5,12 @@
 #ifndef BITCOIN_DB_H
 #define BITCOIN_DB_H
 
-#include "main.h"
+#include "sync.h"
+#include "serialize.h"
+#include "script.h"
+#include "streams.h"
+
+#include <boost/filesystem/path.hpp>
 
 #include <map>
 #include <string>
@@ -27,14 +32,12 @@ class CWalletTx;
 extern unsigned int nWalletDBUpdated;
 
 void ThreadFlushWalletDB(void* parg);
-bool BackupWallet(const CWallet& wallet, const std::string& strDest);
 bool DumpWallet(CWallet* pwallet, const std::string& strDest);
 bool ImportWallet(CWallet* pwallet, const std::string& strLocation);
 
 class CDBEnv
 {
 private:
-    bool fDetachDB;
     bool fDbEnvInit;
     bool fMockDb;
     boost::filesystem::path pathEnv;
@@ -75,8 +78,6 @@ public:
     void Close();
     void Flush(bool fShutdown);
     void CheckpointLSN(std::string strFile);
-    void SetDetach(bool fDetachDB_) { fDetachDB = fDetachDB_; }
-    bool GetDetach() { return fDetachDB; }
 
     void CloseDb(const std::string& strFile);
     bool RemoveDb(const std::string& strFile);
@@ -137,8 +138,7 @@ protected:
             CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION);
             ssValue >> value;
         }
-        catch (std::exception &e) {
-            (void)e;
+        catch (const std::exception&) {
             return false;
         }
 
@@ -319,10 +319,12 @@ class CAddrDB
 {
 private:
     boost::filesystem::path pathAddr;
+    static unsigned char pchMessageStart[4];
 public:
     CAddrDB();
     bool Write(const CAddrMan& addr);
     bool Read(CAddrMan& addr);
+    static void SetMessageStart(unsigned char _pchMessageStart[]) { memcpy(CAddrDB::pchMessageStart, _pchMessageStart, sizeof(CAddrDB::pchMessageStart)); }
 };
 
 #endif // BITCOIN_DB_H