mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Allow wallet files in multiple directories
Remove requirement that two wallet files can only be opened at the same time if they are contained in the same directory. This change mostly consists of updates to function signatures (updating functions to take fs::path arguments, instead of combinations of strings, fs::path, and CDBEnv / CWalletDBWrapper arguments).
This commit is contained in:
@@ -6,26 +6,21 @@
|
||||
|
||||
#include <rpc/server.h>
|
||||
#include <wallet/db.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
|
||||
TestingSetup(chainName)
|
||||
TestingSetup(chainName), m_wallet("mock", CWalletDBWrapper::CreateMock())
|
||||
{
|
||||
bitdb.MakeMock();
|
||||
bool fFirstRun;
|
||||
g_address_type = OUTPUT_TYPE_DEFAULT;
|
||||
g_change_type = OUTPUT_TYPE_DEFAULT;
|
||||
std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat"));
|
||||
pwalletMain = MakeUnique<CWallet>(std::move(dbw));
|
||||
pwalletMain->LoadWallet(fFirstRun);
|
||||
RegisterValidationInterface(pwalletMain.get());
|
||||
m_wallet.LoadWallet(fFirstRun);
|
||||
RegisterValidationInterface(&m_wallet);
|
||||
|
||||
RegisterWalletRPCCommands(tableRPC);
|
||||
}
|
||||
|
||||
WalletTestingSetup::~WalletTestingSetup()
|
||||
{
|
||||
UnregisterValidationInterface(pwalletMain.get());
|
||||
|
||||
bitdb.Flush(true);
|
||||
bitdb.Reset();
|
||||
UnregisterValidationInterface(&m_wallet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user