Merge pull request #6556 from alvasw/scrypt_utils_fix_thread_leak

ScryptUtil: Fix thread leak
This commit is contained in:
Alejandro García 2023-02-05 18:57:10 +00:00 committed by GitHub
commit 80ea00d104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}
}