|
|
@ -62,6 +62,21 @@ public class FileWalletExportPane extends TitledDescriptionPane { |
|
|
|
decryptWalletService.setOnSucceeded(workerStateEvent -> { |
|
|
|
EventManager.get().post(new StorageEvent(file, TimedEvent.Action.END, "Done")); |
|
|
|
Wallet decryptedWallet = decryptWalletService.getValue(); |
|
|
|
exportWallet(file, decryptedWallet); |
|
|
|
}); |
|
|
|
decryptWalletService.setOnFailed(workerStateEvent -> { |
|
|
|
EventManager.get().post(new StorageEvent(file, TimedEvent.Action.END, "Failed")); |
|
|
|
setError("Export Error", decryptWalletService.getException().getMessage()); |
|
|
|
}); |
|
|
|
EventManager.get().post(new StorageEvent(file, TimedEvent.Action.START, "Decrypting wallet...")); |
|
|
|
decryptWalletService.start(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
exportWallet(file, copy); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void exportWallet(File file, Wallet decryptedWallet) { |
|
|
|
try { |
|
|
|
OutputStream outputStream = new FileOutputStream(file); |
|
|
|
exporter.exportWallet(decryptedWallet, outputStream); |
|
|
@ -75,14 +90,5 @@ public class FileWalletExportPane extends TitledDescriptionPane { |
|
|
|
} finally { |
|
|
|
decryptedWallet.clearPrivate(); |
|
|
|
} |
|
|
|
}); |
|
|
|
decryptWalletService.setOnFailed(workerStateEvent -> { |
|
|
|
EventManager.get().post(new StorageEvent(file, TimedEvent.Action.END, "Failed")); |
|
|
|
setError("Export Error", decryptWalletService.getException().getMessage()); |
|
|
|
}); |
|
|
|
EventManager.get().post(new StorageEvent(file, TimedEvent.Action.START, "Decrypting wallet...")); |
|
|
|
decryptWalletService.start(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|