diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-08 16:20:08 +0000 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-20 17:55:01 +0200 |
commit | 33232810dca802a1328e349865d7da86c8c809e1 (patch) | |
tree | 49ff69835af92b9f18f898d1bedc5012ac3f5601 /src/wallet/db.h | |
parent | be9e1a968debbb7ede8ed50e9288a62ff15d1e1e (diff) |
wallet: CWalletDB CDB composition not inheritance
CWalletDB now contains a CDB instead of inheriting from it.
This makes it easier to replace the internal transaction with a different
database, without leaking through internals.
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r-- | src/wallet/db.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index dfce3d76cd..014c6db6c5 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -144,10 +144,10 @@ protected: bool fFlushOnClose; CDBEnv *env; +public: explicit CDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool fFlushOnCloseIn=true); ~CDB() { Close(); } -public: void Flush(); void Close(); static bool Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue)); @@ -164,7 +164,7 @@ private: CDB(const CDB&); void operator=(const CDB&); -protected: +public: template <typename K, typename T> bool Read(const K& key, T& value) { |