From 6cc4a62c0e696dcb9d90ba0504f688e4f644a10f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 26 Aug 2011 14:37:23 -0400 Subject: 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. --- src/db.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/db.cpp') diff --git a/src/db.cpp b/src/db.cpp index 72542705a..a22b17e34 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(); -- cgit v1.2.3