mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-22 14:22:45 +01:00
KeyDerivationTasks: use Thread.sleep()
instead of Guava Uninterrruptables
We don't really need to sleep uninterrruptibly here. The code is only displaying a progress indicator and the `call()` method is already throwing `Exception`.
This commit is contained in:
parent
7f341d9aab
commit
b959b7bdfb
1 changed files with 1 additions and 3 deletions
|
@ -18,7 +18,6 @@ package org.bitcoinj.walletfx.utils;
|
|||
|
||||
import org.bitcoinj.crypto.AesKey;
|
||||
import org.bitcoinj.crypto.KeyCrypterScrypt;
|
||||
import com.google.common.util.concurrent.Uninterruptibles;
|
||||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||
import javafx.concurrent.Task;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -26,7 +25,6 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import javax.annotation.*;
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.bitcoinj.walletfx.utils.GuiUtils.checkGuiThread;
|
||||
|
||||
|
@ -78,7 +76,7 @@ public class KeyDerivationTasks {
|
|||
double progress = (curTime - startTime) / (double) targetTimeMillis;
|
||||
updateProgress(progress, 1.0);
|
||||
|
||||
Uninterruptibles.sleepUninterruptibly(PROGRESS_UPDATE_INTERVAL.toMillis(), TimeUnit.MILLISECONDS);
|
||||
Thread.sleep(PROGRESS_UPDATE_INTERVAL.toMillis());
|
||||
}
|
||||
// Wait for the encryption thread before switching back to main UI.
|
||||
updateProgress(1.0, 1.0);
|
||||
|
|
Loading…
Add table
Reference in a new issue