mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +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());
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user