bitcoin/bitcoin — pull request #3401 by laanwj (2013-12-12 08:10:25+00:00)
Title: Document cs_wallet lock and add AssertLockHeld

- Document what the wallet lock is protecting (did I get this right?)

- Add locking assertions to wallet to all methods that access internal fields and do not aquire the cs_wallet mutex (and add comment why the lock is needed)

- Protect nNextResend and nTimeBestReceived with cs_wallet mutex to avoid an unlikely race

- Change CWallet::SelectCoinsMinConf to a static method (it was not using *any* wallet or keystore fields)