From e0ff42b6a45aee5282a2fac42199b93b7716891f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 17 Feb 2023 08:37:10 +0200 Subject: [PATCH] terminal: add lock menu item to all wallets with a password --- .../sparrow/terminal/wallet/WalletActionsDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WalletActionsDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WalletActionsDialog.java index 49acbc8a..26c58214 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WalletActionsDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WalletActionsDialog.java @@ -4,6 +4,7 @@ import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.gui2.*; import com.googlecode.lanterna.gui2.dialogs.DialogWindow; import com.sparrowwallet.drongo.wallet.Wallet; +import com.sparrowwallet.sparrow.io.Storage; import com.sparrowwallet.sparrow.terminal.SparrowTerminal; import com.sparrowwallet.sparrow.wallet.Function; @@ -48,7 +49,7 @@ public class WalletActionsDialog extends DialogWindow { SettingsDialog settingsDialog = getWalletData().getSettingsDialog(); settingsDialog.showDialog(SparrowTerminal.get().getGui()); }); - if(getWalletData().getWalletForm().getWallet().isEncrypted()) { + if(!Storage.NO_PASSWORD_KEY.equals(getWalletData().getWalletForm().getStorage().getEncryptionPubKey())) { actions.addItem("Lock", () -> { close(); SparrowTerminal.get().lockWallet(getWalletData().getWalletForm().getStorage());