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.
This commit is contained in:
@@ -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<uint256> GetConflicts(const uint256& txid) const;
|
||||
|
||||
Reference in New Issue
Block a user