bitcoinj/bitcoinj — pull request #250 by jarlfr (2014-10-21 12:15:39+00:00)
Title: Deserializing wallet extensions, lock order is now wallet and then extension.

A deadlock condition exists for locks on Wallet and WalletExtension. At save of wallet, wallet lock is acquired and then wallet extensions lock is acquired. At deserialization of a WalletExtension, the extension's lock is acquired and then the wallet lock can be acquired. This happens if the WalletExtension access the wallet, e.g. getTransaction as used in StoredPaymentChannelClientStates. The proposed fix unconditionally acquires the wallet lock before any extension locks.