aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2012-04-09 13:25:17 -0700
committerPieter Wuille <[email protected]>2012-04-09 13:25:17 -0700
commit1a275bac2b5454ae9d6744f28c29cbf40e2fbf13 (patch)
tree4cf7a1b4001ef82c15f4942f6a495aaf530c7d0e /src/bitcoinrpc.cpp
parentMerge branch 'filesystem' of https://github.com/Diapolo/bitcoin (diff)
parentDo not report spurious deadlocks caused by TRY_LOCK (diff)
downloaddiscoin-1a275bac2b5454ae9d6744f28c29cbf40e2fbf13.tar.xz
discoin-1a275bac2b5454ae9d6744f28c29cbf40e2fbf13.zip
Merge pull request #1052 from sipa/scopedlocks
Use scoped locks instead of CRITICAL_BLOCK
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 7353d608b..cbdd21ca1 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -1647,8 +1647,8 @@ Value walletlock(const Array& params, bool fHelp)
if (!pwalletMain->IsCrypted())
throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletlock was called.");
- CRITICAL_BLOCK(cs_nWalletUnlockTime)
{
+ LOCK(cs_nWalletUnlockTime);
pwalletMain->Lock();
nWalletUnlockTime = 0;
}
@@ -2500,9 +2500,10 @@ void ThreadRPCServer2(void* parg)
{
// Execute
Value result;
- CRITICAL_BLOCK(cs_main)
- CRITICAL_BLOCK(pwalletMain->cs_wallet)
+ {
+ LOCK2(cs_main, pwalletMain->cs_wallet);
result = (*(*mi).second)(params, false);
+ }
// Send reply
string strReply = JSONRPCReply(result, Value::null, id);