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 committed 2017-04-20 17:15:30 +02:00
1 parent 987a6c0956
commit 71afe3c099
9 files changed
+171 -97

No files matched your search

+2 -1
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);