|
|
|
@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
|
|
|
|
|
#include "wallet/db.h" |
|
|
|
|
#include "wallet/wallet.h" |
|
|
|
|
|
|
|
|
|
CWallet *pwalletMain; |
|
|
|
|
std::unique_ptr<CWallet> pwalletMain; |
|
|
|
|
|
|
|
|
|
WalletTestingSetup::WalletTestingSetup(const std::string& chainName): |
|
|
|
|
TestingSetup(chainName) |
|
|
|
@ -17,18 +17,17 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
@@ -17,18 +17,17 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
|
|
|
|
|
|
|
|
|
|
bool fFirstRun; |
|
|
|
|
std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat")); |
|
|
|
|
pwalletMain = new CWallet(std::move(dbw)); |
|
|
|
|
pwalletMain = std::unique_ptr<CWallet>(new CWallet(std::move(dbw))); |
|
|
|
|
pwalletMain->LoadWallet(fFirstRun); |
|
|
|
|
RegisterValidationInterface(pwalletMain); |
|
|
|
|
RegisterValidationInterface(pwalletMain.get()); |
|
|
|
|
|
|
|
|
|
RegisterWalletRPCCommands(tableRPC); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WalletTestingSetup::~WalletTestingSetup() |
|
|
|
|
{ |
|
|
|
|
UnregisterValidationInterface(pwalletMain); |
|
|
|
|
delete pwalletMain; |
|
|
|
|
pwalletMain = nullptr; |
|
|
|
|
UnregisterValidationInterface(pwalletMain.get()); |
|
|
|
|
pwalletMain.reset(); |
|
|
|
|
|
|
|
|
|
bitdb.Flush(true); |
|
|
|
|
bitdb.Reset(); |
|
|
|
|