Add event logic
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -25,6 +25,8 @@ namespace WalletWasabi.WabiSabi.Client
ServiceConfiguration = serviceConfiguration;
}
+ public event EventHandler<Wallet>? WalletStatusChanged;
+
public WalletManager WalletManager { get; }
public IBackendHttpClientFactory HttpClientFactory { get; }
public RoundStateUpdater RoundStatusUpdater { get; }
@@ -72,6 +74,7 @@ namespace WalletWasabi.WabiSabi.Client
var coinjoinTask = coinjoinClient.StartCoinJoinAsync(coinCandidates, cts.Token);
trackedWallets.Add(openedWallet.WalletName, new WalletTrackingData(openedWallet, coinjoinClient, coinjoinTask, cts));
+ WalletStatusChanged?.Invoke(this, openedWallet);
}
foreach (var closedWallet in closedWallets.Select(x => x.Value))
@@ -87,10 +90,15 @@ namespace WalletWasabi.WabiSabi.Client
foreach (var finishedCoinJoin in finishedCoinJoins)
{
- var removed = trackedWallets.Remove(finishedCoinJoin.Wallet.WalletName);
+ var walletToRemove = finishedCoinJoin.Wallet;
+ var removed = trackedWallets.Remove(walletToRemove.WalletName);
if (!removed)
{
- Logger.LogWarning($"Wallet: `{finishedCoinJoin.Wallet.WalletName}` was not removed from tracked wallet list. Will retry in a few seconds.");
+ Logger.LogWarning($"Wallet: `{walletToRemove.WalletName}` was not removed from tracked wallet list. Will retry in a few seconds.");
+ }
+ else
+ {
+ WalletStatusChanged?.Invoke(this, walletToRemove);
}
finishedCoinJoin.CancellationTokenSource.Dispose();
}

Add event logic