aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-08-26 14:37:23 -0400
committerGavin Andresen <gavinandresen@gmail.com>2011-08-31 12:55:16 -0400
commit6cc4a62c0e696dcb9d90ba0504f688e4f644a10f (patch)
tree5b365769be7c8be7caf6c31c4bdb1b4798be9ef4 /src/db.cpp
parentb0243da77c6ee8d8ca59b4423f333a179bff02cf (diff)
downloadbitcoin-6cc4a62c0e696dcb9d90ba0504f688e4f644a10f.tar.xz
Fix rpc-hanging deadlocks
Collapsed multiple wallet mutexes to a single cs_wallet, to avoid deadlocks with wallet methods that acquired locks in different order. Also change master RPC call handler to acquire cs_main and cs_wallet locks before executing RPC calls; requiring each RPC call to acquire the right set of locks in the right order was too error-prone.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 72542705a6..a22b17e34c 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -683,8 +683,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
#endif
//// todo: shouldn't we catch exceptions and try to recover and continue?
- CRITICAL_BLOCK(pwallet->cs_mapWallet)
- CRITICAL_BLOCK(pwallet->cs_KeyStore)
+ CRITICAL_BLOCK(pwallet->cs_wallet)
{
// Get cursor
Dbc* pcursor = GetCursor();