mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
ScryptUtil: Fix thread leak
Each time someone called the static method ScryptUtil.deriveKeyWithScrypt(...) a new worker pool was created. The worker pool was never shutdown.
This commit is contained in:
parent
e25c27ec99
commit
5506443d54
1 changed files with 2 additions and 3 deletions
|
@ -18,7 +18,6 @@
|
|||
package bisq.core.crypto;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
|
@ -49,7 +48,7 @@ public class ScryptUtil {
|
|||
}
|
||||
|
||||
public static void deriveKeyWithScrypt(KeyCrypterScrypt keyCrypterScrypt, String password, DeriveKeyResultHandler resultHandler) {
|
||||
Utilities.getThreadPoolExecutor("ScryptUtil:deriveKeyWithScrypt", 1, 2, 5L).submit(() -> {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
log.debug("Doing key derivation");
|
||||
long start = System.currentTimeMillis();
|
||||
|
@ -70,6 +69,6 @@ public class ScryptUtil {
|
|||
log.error("Executing task failed. " + t.getMessage());
|
||||
throw t;
|
||||
}
|
||||
});
|
||||
}, "ScryptUtil:deriveKeyWithScrypt").start();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue