Move AutoCoinJoin property to KeyManager to be a wallet specific setting
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
@@ -15,7 +15,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
var wallet = walletViewModelBase.Wallet;
Title = $"{wallet.WalletName} - Wallet Settings";
_preferPsbtWorkflow = wallet.KeyManager.PreferPsbtWorkflow;
- _autoCoinJoin = Services.UiConfig.AutoCoinJoin;
+ _autoCoinJoin = wallet.KeyManager.AutoCoinJoin;
IsHardwareWallet = wallet.KeyManager.IsHardwareWallet;
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
@@ -33,7 +33,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
this.WhenAnyValue(x => x.AutoCoinJoin)
.ObserveOn(RxApp.TaskpoolScheduler)
.Skip(1)
- .Subscribe(x => Services.UiConfig.AutoCoinJoin = x);
+ .Subscribe(x =>
+ {
+ wallet.KeyManager.AutoCoinJoin = x;
+ wallet.KeyManager.ToFile();
+ });
}
public bool IsHardwareWallet { get; }

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -25,7 +25,6 @@ namespace WalletWasabi.Gui
private string? _lastSelectedWallet;
private string _windowState = "Normal";
private bool _usePsbtWorkflow;
- private bool _autoCoinJoin;
public UiConfig() : base()
{
@@ -42,8 +41,7 @@ namespace WalletWasabi.Gui
x => x.FeeDisplayFormat,
x => x.LastSelectedWallet,
x => x.WindowState,
- x => x.AutoCoinJoin,
- (_, _, _, _, _, _, _, _, _) => Unit.Default)
+ (_, _, _, _, _, _, _, _) => Unit.Default)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.TaskpoolScheduler)
@@ -138,14 +136,6 @@ namespace WalletWasabi.Gui
set => RaiseAndSetIfChanged(ref _lastSelectedWallet, value);
}
- [DefaultValue(true)]
- [JsonProperty(PropertyName = "AutoCoinJoin", DefaultValueHandling = DefaultValueHandling.Populate)]
- public bool AutoCoinJoin
- {
- get => _autoCoinJoin;
- set => RaiseAndSetIfChanged(ref _autoCoinJoin, value);
- }
-
[JsonProperty(PropertyName = "CoinListViewSortingPreference")]
[JsonConverter(typeof(SortingPreferenceJsonConverter))]
public SortingPreference CoinListViewSortingPreference { get; internal set; } = new SortingPreference(SortOrder.Increasing, "Amount");

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -2,6 +2,7 @@ using NBitcoin;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
@@ -128,6 +129,10 @@ namespace WalletWasabi.Blockchain.Keys
[JsonProperty(Order = 11, PropertyName = "PreferPsbtWorkflow")]
public bool PreferPsbtWorkflow { get; set; }
+ [DefaultValue(true)]
+ [JsonProperty(Order = 12, PropertyName = "AutoCoinJoin", DefaultValueHandling = DefaultValueHandling.Populate)]
+ public bool AutoCoinJoin { get; set; }
+
private object BlockchainStateLock { get; }
private object HdPubKeysLock { get; }

Move AutoCoinJoin property to KeyManager to be a wallet specific setting