Multiwalleting generate wallet
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -61,14 +61,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.Where(x => x is { })
.Subscribe(wallet =>
{
- if (wallet.State <= WalletState.Starting)
- {
- Wallets.InsertSorted(new ClosedWalletViewModel(wallet));
- }
- else
- {
- Wallets.InsertSorted(new WalletViewModel(wallet));
- }
+ WalletViewModelBase vm = (wallet.State <= WalletState.Starting) ?
+ new ClosedWalletViewModel(wallet) :
+ (WalletViewModelBase)new WalletViewModel(wallet);
+
+ InsertWallet(vm);
});
var shell = IoC.Get<IShell>();

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletSuccessViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletSuccessViewModel.cs
@@ -9,6 +9,7 @@ using WalletWasabi.Helpers;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Models;
using WalletWasabi.Gui.Helpers;
+using Splat;
namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
{
@@ -19,10 +20,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
public GenerateWalletSuccessViewModel(WalletManagerViewModel owner, KeyManager keyManager, Mnemonic mnemonic) : base("Wallet Generated Successfully!")
{
_mnemonicWords = mnemonic.ToString();
+ var global = Locator.Current.GetService<Global>();
ConfirmCommand = ReactiveCommand.Create(() =>
{
- keyManager.ToFile();
+ var wallet = global.WalletManager.AddWallet(keyManager);
NotificationHelpers.Success("Wallet was generated.");
owner.SelectTestPassword();
});

MODIFY
WalletWasabi/Wallets/WalletManager.cs
WalletWasabi/Wallets/WalletManager.cs
@@ -211,7 +211,7 @@ namespace WalletWasabi.Wallets
return StartWalletAsync(wallet);
}
- private Wallet AddWallet(KeyManager keyManager)
+ public Wallet AddWallet(KeyManager keyManager)
{
Wallet wallet = new Wallet(WalletDirectories.WorkDir, Network, keyManager);
AddWallet(wallet);
@@ -269,6 +269,11 @@ namespace WalletWasabi.Wallets
Wallets.Add(wallet, new HashSet<uint256>());
}
+ if (!File.Exists(WalletDirectories.GetWalletFilePaths(wallet.WalletName).walletFilePath))
+ {
+ wallet.KeyManager.ToFile();
+ }
+
wallet.WalletRelevantTransactionProcessed += TransactionProcessor_WalletRelevantTransactionProcessed;
wallet.OnDequeue += ChaumianClient_OnDequeue;
wallet.StateChanged += Wallet_StateChanged;

Multiwalleting generate wallet