tests: move pwalletMain to wallet test fixture

Scope the variable instead of using an external global; this is how test
fixtures are intended to be used.

Followup to #11713.
This commit is contained in:
Wladimir J. van der Laan
2017-11-18 14:11:34 +01:00
parent 49667a77e7
commit 49bd6590fe
4 changed files with 11 additions and 15 deletions

View File

@@ -6,9 +6,6 @@
#include <rpc/server.h>
#include <wallet/db.h>
#include <wallet/wallet.h>
std::unique_ptr<CWallet> pwalletMain;
WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
TestingSetup(chainName)
@@ -27,7 +24,6 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
WalletTestingSetup::~WalletTestingSetup()
{
UnregisterValidationInterface(pwalletMain.get());
pwalletMain.reset();
bitdb.Flush(true);
bitdb.Reset();