Use wallet class directly.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ClosedWalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ClosedWalletViewModel.cs
@@ -9,12 +9,13 @@ using System.Reactive.Linq;
using System.Threading;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Logging;
+using WalletWasabi.Wallets;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class ClosedWalletViewModel : WalletViewModelBase
{
- public ClosedWalletViewModel(string path) : base(Path.GetFileNameWithoutExtension(path))
+ public ClosedWalletViewModel(Wallet wallet) : base(wallet)
{
OpenWalletCommand = ReactiveCommand.CreateFromTask(async () =>
{
@@ -29,16 +30,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
return;
}
- var walletManager = global.WalletManager;
-
- var keyManager = global.LoadKeyManager(Title);
-
- if (keyManager is null)
- {
- return;
- }
-
- var wallet = await walletManager.CreateAndStartWalletAsync(keyManager);
+ await global.WalletManager.StartWalletAsync(wallet.KeyManager);
var walletExplorer = IoC.Get<WalletExplorerViewModel>();

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -73,9 +73,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void LoadWallets()
{
- foreach (var walletPath in WalletManager.WalletDirectories.EnumerateWalletFiles())
+ foreach (var wallet in WalletManager
+ .GetKeyManagers()
+ .Where(x => !x.IsWatchOnly)) // If password isn't required then add the wallet, otherwise add only not watchonly wallets.
+
{
- Wallets.InsertSorted(new ClosedWalletViewModel(walletPath.FullName));
+ Wallets.InsertSorted(new ClosedWalletViewModel(WalletManager.GetWalletByName(wallet.WalletName)));
}
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -19,7 +19,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
private ObservableCollection<WasabiDocumentTabViewModel> _actions;
- public WalletViewModel(Wallet wallet) : base(wallet.WalletName)
+ public WalletViewModel(Wallet wallet) : base(wallet)
{
Wallet = Guard.NotNull(nameof(wallet), wallet);
@@ -47,7 +47,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
try
{
Money balance = Wallet.Coins.TotalAmount();
- Title = $"{WalletName} ({(Global.UiConfig.LurkingWifeMode ? "#########" : balance.ToString(false, true))} BTC)";
+ //Title = $"{WalletName} ({(Global.UiConfig.LurkingWifeMode ? "#########" : balance.ToString(false, true))} BTC)";
}
catch (Exception ex)
{

Use wallet class directly.