disable autocoinjoin when profile is not selected
MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
@@ -3,8 +3,6 @@ using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.AddWallet;
-using WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
-using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Login.PasswordFinder;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets;
@@ -68,28 +66,10 @@ public partial class LoginViewModel : RoutableViewModel
var legalResult = await ShowLegalAsync();
if (legalResult)
- {
- var km = closedWalletViewModel.Wallet.KeyManager;
- bool shouldSelectProfile = !km.IsCoinjoinProfileSelected && km.AutoCoinJoin;
- bool isProfileSelected = false;
-
- // This should be impossible, this is just a sanity check
- if (shouldSelectProfile)
- {
- DialogResult<bool> profileDialogResult = await NavigateDialogAsync(new CoinJoinProfilesViewModel(closedWalletViewModel.Wallet.KeyManager, false), NavigationTarget.DialogScreen);
- isProfileSelected = profileDialogResult.Result;
- }
-
- if (isProfileSelected || !shouldSelectProfile)
{
LoginWallet(closedWalletViewModel);
}
else
- {
- wallet.Logout();
- }
- }
- else
{
wallet.Logout();
ErrorMessage = "You must accept the Terms and Conditions!";

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -5,6 +5,7 @@ using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
+using System.Runtime.Serialization;
using System.Security;
using System.Text;
using WalletWasabi.Blockchain.Analysis.Clustering;
@@ -90,6 +91,17 @@ public class KeyManager
ExtPubKey = extKey.Derive(AccountKeyPath).Neuter();
}
+ [OnDeserialized]
+ internal void OnDeserializedMethod(StreamingContext context)
+ {
+ // This should be impossible but in any case, coinjoin can only happen,
+ // if a profile is selected. Otherwise, the user's money can be drained.
+ if (AutoCoinJoin && !IsCoinjoinProfileSelected)
+ {
+ AutoCoinJoin = false;
+ }
+ }
+
public static KeyPath GetAccountKeyPath(Network network) =>
network == Network.TestNet ? TestNetAccountKeyPath : DefaultAccountKeyPath;

disable autocoinjoin when profile is not selected