wallet: Introduce database handle wrapper

Abstract database handle from explicit strFilename into
CWalletDBWrapper.

Also move CWallet::Backup to db.cpp - as it deals with representation
details this is a database specific operation.
This commit is contained in:
Wladimir J. van der Laan
2017-03-08 11:48:58 +01:00
parent 987a6c0956
commit 71afe3c099
9 changed files with 171 additions and 97 deletions

View File

@@ -14,7 +14,8 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
bitdb.MakeMock();
bool fFirstRun;
pwalletMain = new CWallet("wallet_test.dat");
std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat"));
pwalletMain = new CWallet(std::move(dbw));
pwalletMain->LoadWallet(fFirstRun);
RegisterValidationInterface(pwalletMain);