diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-03-03 07:49:12 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2015-03-03 09:01:46 -0800 |
commit | 51598b26319bf1ee98b399dee8152b902c62891a (patch) | |
tree | 21805efdbe19e67f3ed953695cb5f27c9d4ff4fe /src/walletdb.cpp | |
parent | 86eb461c5bbe8200ab066f75b5acdf79fbae1086 (diff) |
Reinitialize state in between individual unit tests.
This changes the TestingSetup fixture to be per-unit-test rather than global.
Most tests don't need it, so it's only invoked in a few.
Diffstat (limited to 'src/walletdb.cpp')
-rw-r--r-- | src/walletdb.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/walletdb.cpp b/src/walletdb.cpp index b2daf036ff..ddec57d9a9 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -903,8 +903,8 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) int64_t now = GetTime(); std::string newFilename = strprintf("wallet.%d.bak", now); - int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL, - newFilename.c_str(), DB_AUTO_COMMIT); + int result = dbenv.dbenv->dbrename(NULL, filename.c_str(), NULL, + newFilename.c_str(), DB_AUTO_COMMIT); if (result == 0) LogPrintf("Renamed %s to %s\n", filename, newFilename); else @@ -923,7 +923,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) LogPrintf("Salvage(aggressive) found %u records\n", salvagedData.size()); bool fSuccess = allOK; - boost::scoped_ptr<Db> pdbCopy(new Db(&dbenv.dbenv, 0)); + boost::scoped_ptr<Db> pdbCopy(new Db(dbenv.dbenv, 0)); int ret = pdbCopy->open(NULL, // Txn pointer filename.c_str(), // Filename "main", // Logical db name |