mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 05:27:17 +00:00
Fixing potential deadlock by enforcing keychain > extensions order.
Brought about by fix in 5181cefcf2.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user