mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
wallet: Add AddWallet, RemoveWallet, GetWallet and GetWallets
With these new functions all vpwallets usage are removed and vpwallets is now a static variable (no external linkage).
This commit is contained in:
@@ -74,7 +74,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
// after.
|
||||
{
|
||||
CWallet wallet("dummy", WalletDatabase::CreateDummy());
|
||||
vpwallets.insert(vpwallets.begin(), &wallet);
|
||||
AddWallet(&wallet);
|
||||
UniValue keys;
|
||||
keys.setArray();
|
||||
UniValue key;
|
||||
@@ -105,7 +105,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
"downloading and rescanning the relevant blocks (see -reindex and -rescan "
|
||||
"options).\"}},{\"success\":true}]",
|
||||
0, oldTip->GetBlockTimeMax(), TIMESTAMP_WINDOW));
|
||||
vpwallets.erase(vpwallets.begin());
|
||||
RemoveWallet(&wallet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,9 +140,9 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
JSONRPCRequest request;
|
||||
request.params.setArray();
|
||||
request.params.push_back((pathTemp / "wallet.backup").string());
|
||||
vpwallets.insert(vpwallets.begin(), &wallet);
|
||||
AddWallet(&wallet);
|
||||
::dumpwallet(request);
|
||||
vpwallets.erase(vpwallets.begin());
|
||||
RemoveWallet(&wallet);
|
||||
}
|
||||
|
||||
// Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME
|
||||
@@ -153,9 +153,9 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
JSONRPCRequest request;
|
||||
request.params.setArray();
|
||||
request.params.push_back((pathTemp / "wallet.backup").string());
|
||||
vpwallets.insert(vpwallets.begin(), &wallet);
|
||||
AddWallet(&wallet);
|
||||
::importwallet(request);
|
||||
vpwallets.erase(vpwallets.begin());
|
||||
RemoveWallet(&wallet);
|
||||
|
||||
LOCK(wallet.cs_wallet);
|
||||
BOOST_CHECK_EQUAL(wallet.mapWallet.size(), 3U);
|
||||
|
||||
Reference in New Issue
Block a user