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