Browse Source

locks: don't lock cs_wallet before making rpc calls

0.13
Cory Fields 9 years ago
parent
commit
605433ffb5
  1. 19
      src/test/rpc_wallet_tests.cpp

19
src/test/rpc_wallet_tests.cpp

@ -27,8 +27,6 @@ BOOST_FIXTURE_TEST_SUITE(rpc_wallet_tests, TestingSetup) @@ -27,8 +27,6 @@ BOOST_FIXTURE_TEST_SUITE(rpc_wallet_tests, TestingSetup)
BOOST_AUTO_TEST_CASE(rpc_addmultisig)
{
LOCK(pwalletMain->cs_wallet);
rpcfn_type addmultisig = tableRPC["addmultisigaddress"]->actor;
// old, 65-byte-long:
@ -68,13 +66,16 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) @@ -68,13 +66,16 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
{
// Test RPC calls for various wallet statistics
UniValue r;
LOCK2(cs_main, pwalletMain->cs_wallet);
CPubKey demoPubkey = pwalletMain->GenerateNewKey();
CBitcoinAddress demoAddress = CBitcoinAddress(CTxDestination(demoPubkey.GetID()));
CPubKey demoPubkey;
CBitcoinAddress demoAddress;
UniValue retValue;
string strAccount = "walletDemoAccount";
CBitcoinAddress setaccountDemoAddress;
{
LOCK(pwalletMain->cs_wallet);
demoPubkey = pwalletMain->GenerateNewKey();
demoAddress = CBitcoinAddress(CTxDestination(demoPubkey.GetID()));
string strPurpose = "receive";
BOOST_CHECK_NO_THROW({ /*Initialize Wallet with an account */
CWalletDB walletdb(pwalletMain->strWalletFile);
@ -85,8 +86,8 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) @@ -85,8 +86,8 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
});
CPubKey setaccountDemoPubkey = pwalletMain->GenerateNewKey();
CBitcoinAddress setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID()));
setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID()));
}
/*********************************
* setaccount
*********************************/

Loading…
Cancel
Save