From ca4cf5cff6fb60c9769b62acce2e3a8fcd0e7aae Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 18 Feb 2014 12:11:46 -0500 Subject: Wallet locking fixes for -DDEBUG_LOCKORDER Compiling with -DDEBUG_LOCKORDER and running the qa/rpc-test/ regression tests uncovered a couple of wallet methods that should (but didn't) acquire the cs_wallet mutext. I also changed the AssertLockHeld() routine print to stderr and abort, instead of printing to debug.log and then assert()'ing. It is annoying to look in debug.log to find out which AssertLockHeld is failing. --- src/wallet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wallet.h') diff --git a/src/wallet.h b/src/wallet.h index 95fb0ee9de..eb192f1ca6 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -363,7 +363,7 @@ public: bool SetMaxVersion(int nVersion); // get the current wallet format (the oldest client version guaranteed to understand this wallet) - int GetVersion() { AssertLockHeld(cs_wallet); return nWalletVersion; } + int GetVersion() { LOCK(cs_wallet); return nWalletVersion; } // Get wallet transactions that conflict with given transaction (spend same outputs) std::set GetConflicts(const uint256& txid) const; -- cgit v1.2.3