bitcoin/bitcoin — pull request #3849 by cozz (2014-03-11 22:46:25+00:00)
Title: Fix missing wallet lock in CWallet::SyncTransaction(..)

Looks like we are currently accessing mapWallet without a lock held in CWallet::SyncTransaction(..).
I tested this with AssertLockHeld(cs_wallet) and indeed, no lock.

- moved the lock from AddToWalletIfInvolvingMe(..) to SyncTransaction(..)
- using return value of AddToWalletIfInvolvingMe(..) to determine whether the tx is in the wallet