mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-30 03:21:23 +00:00
KeyChainGroup: Be smarter about encryption order.
This partly reverts commit 4ed5b0e3b06c18040d83be30df32e7be5b778b51.
This commit is contained in:
committed by
Andreas Schildbach
parent
80dd4e39fa
commit
c572bb52d7
@@ -671,15 +671,17 @@ public class KeyChainGroup implements KeyBag {
|
||||
// This code must be exception safe.
|
||||
|
||||
BasicKeyChain newBasic = basic.toEncrypted(keyCrypter, aesKey);
|
||||
this.basic = newBasic;
|
||||
List<DeterministicKeyChain> newChains = new ArrayList<>();
|
||||
if (chains != null) {
|
||||
for (DeterministicKeyChain chain : chains)
|
||||
newChains.add(chain.toEncrypted(keyCrypter, aesKey));
|
||||
}
|
||||
this.keyCrypter = keyCrypter;
|
||||
this.basic = newBasic;
|
||||
if (chains != null) {
|
||||
this.chains.clear();
|
||||
this.chains.addAll(newChains);
|
||||
}
|
||||
this.keyCrypter = keyCrypter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user