mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-08-02 00:31:24 +00:00
Fix potential race condition when checking keychain for key rotation time.
This commit is contained in:
@@ -4459,13 +4459,13 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
|
|||||||
checkState(keychainLock.isHeldByCurrentThread());
|
checkState(keychainLock.isHeldByCurrentThread());
|
||||||
List<Transaction> results = Lists.newLinkedList();
|
List<Transaction> results = Lists.newLinkedList();
|
||||||
// TODO: Handle chain replays here.
|
// TODO: Handle chain replays here.
|
||||||
long keyRotationTimestamp = vKeyRotationTimestamp;
|
final long keyRotationTimestamp = vKeyRotationTimestamp;
|
||||||
if (keyRotationTimestamp == 0) return results; // Nothing to do.
|
if (keyRotationTimestamp == 0) return results; // Nothing to do.
|
||||||
|
|
||||||
// We might have to create a new HD hierarchy if the previous ones are now rotating.
|
// We might have to create a new HD hierarchy if the previous ones are now rotating.
|
||||||
boolean allChainsRotating = true;
|
boolean allChainsRotating = true;
|
||||||
for (DeterministicKeyChain chain : keychain.getDeterministicKeyChains()) {
|
for (DeterministicKeyChain chain : keychain.getDeterministicKeyChains()) {
|
||||||
if (chain.getEarliestKeyCreationTime() >= vKeyRotationTimestamp) {
|
if (chain.getEarliestKeyCreationTime() >= keyRotationTimestamp) {
|
||||||
allChainsRotating = false;
|
allChainsRotating = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user