X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.h;h=d04bd2d63f74521b077041759b7cba58295a7213;hb=HEAD;hp=993b7a7b3b9f30b08e4896cc4d445af7669bdef0;hpb=bcc394de4632a8d08658f6d200d5b55c1619c724;p=novacoin.git diff --git a/src/db.h b/src/db.h index 993b7a7..d04bd2d 100644 --- 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 #include #include @@ -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