From ededb107a3b9c4562803ce2ef1ccb62e7103aa9a Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 6 Jun 2022 15:09:56 +0200 Subject: [PATCH] check proposed wallet name against open wallets --- src/main/java/com/sparrowwallet/sparrow/io/Storage.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Storage.java b/src/main/java/com/sparrowwallet/sparrow/io/Storage.java index 34dfb52c..c2431f15 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Storage.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Storage.java @@ -5,6 +5,7 @@ import com.sparrowwallet.drongo.SecureString; import com.sparrowwallet.drongo.Utils; import com.sparrowwallet.drongo.crypto.*; import com.sparrowwallet.drongo.wallet.Wallet; +import com.sparrowwallet.sparrow.AppServices; import com.sparrowwallet.sparrow.MainApp; import javafx.concurrent.Service; import javafx.concurrent.Task; @@ -299,6 +300,10 @@ public class Storage { } } + if(AppServices.get().getOpenWallets().keySet().stream().anyMatch(wallet -> walletName.equals(wallet.getName()))) { + return true; + } + return RESERVED_WALLET_NAMES.contains(walletName); }