Fixing potential deadlock by enforcing keychain > extensions order.

Brought about by fix in 5181cefcf2.
This commit is contained in:
Michael Bell
2015-06-01 23:53:43 +01:00
committed by Mike Hearn
parent caa294c7f6
commit 9b82c69946

View File

@@ -4462,6 +4462,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
*/
public void deserializeExtension(WalletExtension extension, byte[] data) throws Exception {
lock.lock();
keychainLock.lock();
try {
// This method exists partly to establish a lock ordering of wallet > extension.
extension.deserializeWalletExtension(this, data);
@@ -4471,6 +4472,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
extensions.remove(extension.getWalletExtensionID());
Throwables.propagate(throwable);
} finally {
keychainLock.unlock();
lock.unlock();
}
}