handle wallets separately when are in send workflow
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -307,7 +307,7 @@ public partial class SendViewModel : RoutableViewModel
if (_coinJoinManager is { } coinJoinManager)
{
- coinJoinManager.IsUserInSendWorkflow = true;
+ coinJoinManager.WalletEnteredSendWorkflow(_wallet);
}
}
@@ -329,7 +329,7 @@ public partial class SendViewModel : RoutableViewModel
if (!isInHistory && _coinJoinManager is { } coinJoinManager)
{
- coinJoinManager.IsUserInSendWorkflow = false;
+ _coinJoinManager?.WalletLeftSendWorkflow(_wallet);
}
}
}

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -41,7 +41,7 @@ public class CoinJoinManager : BackgroundService
public RoundStateUpdater RoundStatusUpdater { get; }
public string CoordinatorIdentifier { get; }
private CoinRefrigerator CoinRefrigerator { get; } = new();
- public bool IsUserInSendWorkflow { get; set; }
+ private HashSet<string> WalletsInSendWorkflow { get; } = new ();
public event EventHandler<StatusChangedEventArgs>? StatusChanged;
@@ -153,7 +153,7 @@ public class CoinJoinManager : BackgroundService
return;
}
- if (IsUserInSendWorkflow)
+ if (WalletsInSendWorkflow.Contains(walletToStart.WalletName))
{
ScheduleRestartAutomatically(walletToStart, trackedAutoStarts, startCommand.StopWhenAllMixed, startCommand.OverridePlebStop, stoppingToken);
@@ -523,6 +523,10 @@ public class CoinJoinManager : BackgroundService
}
}
+ public void WalletEnteredSendWorkflow(IWallet wallet) => WalletsInSendWorkflow.Add(wallet.WalletName);
+
+ public void WalletLeftSendWorkflow(IWallet wallet) => WalletsInSendWorkflow.Remove(wallet.WalletName);
+
private void CoinJoinTracker_WalletCoinJoinProgressChanged(object? sender, CoinJoinProgressEventArgs e)
{
if (sender is not IWallet wallet)

handle wallets separately when are in send workflow