diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-09 12:43:21 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-09 12:51:07 +0100 |
commit | cdae53e456ad35216e33a90f1681aade546cc431 (patch) | |
tree | d21c3163a804c7542241c089075586acd16c218e /src/db.h | |
parent | c1b723c30a57811ad5801ab8a839186b654ae2bf (diff) | |
parent | 51598b26319bf1ee98b399dee8152b902c62891a (diff) | |
download | bitcoin-cdae53e456ad35216e33a90f1681aade546cc431.tar.xz |
Merge pull request #5852
51598b2 Reinitialize state in between individual unit tests. (Pieter Wuille)
Diffstat (limited to 'src/db.h')
-rw-r--r-- | src/db.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -39,12 +39,14 @@ private: public: mutable CCriticalSection cs_db; - DbEnv dbenv; + DbEnv *dbenv; std::map<std::string, int> mapFileUseCount; std::map<std::string, Db*> mapDb; CDBEnv(); ~CDBEnv(); + void Reset(); + void MakeMock(); bool IsMock() { return fMockDb; } @@ -79,7 +81,7 @@ public: DbTxn* TxnBegin(int flags = DB_TXN_WRITE_NOSYNC) { DbTxn* ptxn = NULL; - int ret = dbenv.txn_begin(NULL, &ptxn, flags); + int ret = dbenv->txn_begin(NULL, &ptxn, flags); if (!ptxn || ret != 0) return NULL; return ptxn; |