mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #8694: Basic multiwallet support
c237bd7wallet: Update formatting (Luke Dashjr)9cbe8c8wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets (Luke Dashjr)a2a5f3fwallet: Base backup filenames on original wallet filename (Luke Dashjr)b823a4cwallet: Include actual backup filename in recovery warning message (Luke Dashjr)84dcb45Bugfix: wallet: Fix warningStr, errorStr argument order (Luke Dashjr)008c360Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets (Luke Dashjr)0f08575Wallet: Support loading multiple wallets if -wallet used more than once (Luke Dashjr)b124cf0Wallet: Replace pwalletMain with a vector of wallet pointers (Luke Dashjr)19b3648CWalletDB: Store the update counter per wallet (Luke Dashjr)74e8738Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append (Luke Dashjr)23fb9adwallet: Move nAccountingEntryNumber from static/global to CWallet (Luke Dashjr)9d15d55Bugfix: wallet: Increment "update counter" when modifying account stuff (Luke Dashjr)f28eb80Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races (Luke Dashjr) Tree-SHA512: 23f5dda58477307bc07997010740f1dc729164cdddefd2f9a2c9c7a877111eb1516d3e2ad4f9b104621f0b7f17369c69fcef13d28b85cb6c01d35f09a8845f23
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <univalue.h>
|
||||
|
||||
extern CWallet* pwalletMain;
|
||||
|
||||
extern UniValue importmulti(const JSONRPCRequest& request);
|
||||
extern UniValue dumpwallet(const JSONRPCRequest& request);
|
||||
extern UniValue importwallet(const JSONRPCRequest& request);
|
||||
@@ -401,8 +403,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
// after.
|
||||
{
|
||||
CWallet wallet;
|
||||
CWallet *backup = ::pwalletMain;
|
||||
::pwalletMain = &wallet;
|
||||
vpwallets.insert(vpwallets.begin(), &wallet);
|
||||
UniValue keys;
|
||||
keys.setArray();
|
||||
UniValue key;
|
||||
@@ -433,7 +434,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));
|
||||
::pwalletMain = backup;
|
||||
vpwallets.erase(vpwallets.begin());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,7 +444,6 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
// than or equal to key birthday.
|
||||
BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
{
|
||||
CWallet *pwalletMainBackup = ::pwalletMain;
|
||||
LOCK(cs_main);
|
||||
|
||||
// Create two blocks with same timestamp to verify that importwallet rescan
|
||||
@@ -469,7 +469,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
JSONRPCRequest request;
|
||||
request.params.setArray();
|
||||
request.params.push_back("wallet.backup");
|
||||
::pwalletMain = &wallet;
|
||||
vpwallets.insert(vpwallets.begin(), &wallet);
|
||||
::dumpwallet(request);
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
JSONRPCRequest request;
|
||||
request.params.setArray();
|
||||
request.params.push_back("wallet.backup");
|
||||
::pwalletMain = &wallet;
|
||||
vpwallets[0] = &wallet;
|
||||
::importwallet(request);
|
||||
|
||||
BOOST_CHECK_EQUAL(wallet.mapWallet.size(), 3);
|
||||
@@ -494,7 +494,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||
}
|
||||
|
||||
SetMockTime(0);
|
||||
::pwalletMain = pwalletMainBackup;
|
||||
vpwallets.erase(vpwallets.begin());
|
||||
}
|
||||
|
||||
// Check that GetImmatureCredit() returns a newly calculated value instead of
|
||||
|
||||
Reference in New Issue
Block a user