Remove Chaumian CoinJoinClient from wallet.cs
MODIFY
WalletWasabi/Wallets/Wallet.cs
WalletWasabi/Wallets/Wallet.cs
@@ -75,7 +75,6 @@ namespace WalletWasabi.Wallets
public BitcoinStore BitcoinStore { get; private set; }
public KeyManager KeyManager { get; }
public WasabiSynchronizer Synchronizer { get; private set; }
- public CoinJoinClient ChaumianClient { get; private set; }
public ServiceConfiguration ServiceConfiguration { get; private set; }
public string WalletName => KeyManager.WalletName;
@@ -141,14 +140,10 @@ namespace WalletWasabi.Wallets
ServiceConfiguration = Guard.NotNull(nameof(serviceConfiguration), serviceConfiguration);
FeeProvider = Guard.NotNull(nameof(feeProvider), feeProvider);
- ChaumianClient = new CoinJoinClient(Synchronizer, Network, KeyManager, Kitchen);
-
TransactionProcessor = new TransactionProcessor(BitcoinStore.TransactionStore, KeyManager, ServiceConfiguration.DustThreshold, ServiceConfiguration.PrivacyLevelStrong);
Coins = TransactionProcessor.Coins;
TransactionProcessor.WalletRelevantTransactionProcessed += TransactionProcessor_WalletRelevantTransactionProcessedAsync;
- ChaumianClient.OnDequeue += ChaumianClient_OnDequeue;
-
BitcoinStore.IndexStore.NewFilter += IndexDownloader_NewFilterAsync;
BitcoinStore.IndexStore.Reorged += IndexDownloader_ReorgedAsync;
BitcoinStore.MempoolService.TransactionReceived += Mempool_TransactionReceived;
@@ -188,8 +183,6 @@ namespace WalletWasabi.Wallets
{
await RuntimeParams.LoadAsync().ConfigureAwait(false);
- ChaumianClient.Start();
-
using (await HandleFiltersLock.LockAsync(cancel).ConfigureAwait(false))
{
await LoadWalletStateAsync(cancel).ConfigureAwait(false);
@@ -273,10 +266,6 @@ namespace WalletWasabi.Wallets
BitcoinStore.IndexStore.Reorged -= IndexDownloader_ReorgedAsync;
BitcoinStore.MempoolService.TransactionReceived -= Mempool_TransactionReceived;
TransactionProcessor.WalletRelevantTransactionProcessed -= TransactionProcessor_WalletRelevantTransactionProcessedAsync;
- ChaumianClient.OnDequeue -= ChaumianClient_OnDequeue;
-
- await ChaumianClient.StopAsync(cancel).ConfigureAwait(false);
- Logger.LogInfo($"{nameof(ChaumianClient)} is stopped.");
}
}
}
@@ -290,38 +279,6 @@ namespace WalletWasabi.Wallets
{
try
{
- foreach (var coin in e.NewlySpentCoins.Concat(e.ReplacedCoins).Concat(e.SuccessfullyDoubleSpentCoins).Distinct())
- {
- ChaumianClient.ExposedLinks.TryRemove(coin.OutPoint, out _);
- }
- }
- catch (Exception ex)
- {
- Logger.LogError(ex);
- }
-
- try
- {
- IEnumerable<SmartCoin> newCoins = e.NewlyReceivedCoins.Concat(e.RestoredCoins).Distinct();
- if (newCoins.Any())
- {
- if (ChaumianClient.State.Contains(e.Transaction.Transaction.Inputs.Select(x => x.PrevOut)))
- {
- var coinsToQueue = new HashSet<SmartCoin>();
- foreach (var newCoin in newCoins)
- {
- // If it's being mixed and anonset is not sufficient, then queue it.
- if (!newCoin.IsSpent() && Kitchen.HasIngredients
- && newCoin.HdPubKey.AnonymitySet < ServiceConfiguration.GetMixUntilAnonymitySetValue())
- {
- coinsToQueue.Add(newCoin);
- }
- }
-
- await ChaumianClient.QueueCoinsToMixAsync(coinsToQueue).ConfigureAwait(false);
- }
- }
-
WalletRelevantTransactionProcessed?.Invoke(this, e);
}
catch (Exception ex)
@@ -330,11 +287,6 @@ namespace WalletWasabi.Wallets
}
}
- private void ChaumianClient_OnDequeue(object? sender, DequeueResult e)
- {
- OnDequeue?.Invoke(this, e);
- }
-
private void Mempool_TransactionReceived(object? sender, SmartTransaction tx)
{
try

MODIFY
WalletWasabi/Wallets/WalletManager.cs
WalletWasabi/Wallets/WalletManager.cs
@@ -98,17 +98,6 @@ namespace WalletWasabi.Wallets
}
}
- public void SignalQuitPending(bool isQuitPending)
- {
- lock (Lock)
- {
- foreach (var client in Wallets.Where(x => x.ChaumianClient is { }).Select(x => x.ChaumianClient))
- {
- client.IsQuitPending = isQuitPending;
- }
- }
- }
-
public IEnumerable<Wallet> GetWallets(bool refreshWalletList = true)
{
if (refreshWalletList)
@@ -266,16 +255,6 @@ namespace WalletWasabi.Wallets
WalletAdded?.Invoke(this, wallet);
}
- public async Task DequeueAllCoinsGracefullyAsync(DequeueReason reason, CancellationToken token)
- {
- IEnumerable<Task> tasks;
- lock (Lock)
- {
- tasks = Wallets.Where(x => x.ChaumianClient is { }).Select(x => x.ChaumianClient.DequeueAllCoinsFromMixGracefullyAsync(reason, token)).ToArray();
- }
- await Task.WhenAll(tasks).ConfigureAwait(false);
- }
-
public bool WalletExists(HDFingerprint? fingerprint) => GetWallets().Any(x => fingerprint is { } && x.KeyManager.MasterFingerprint == fingerprint);
private void ChaumianClient_OnDequeue(object? sender, DequeueResult e)
@@ -434,13 +413,5 @@ namespace WalletWasabi.Wallets
return Wallets.Single(x => x.KeyManager.WalletName == walletName);
}
}
-
- public bool AnyCoinJoinInProgress()
- {
- lock (Lock)
- {
- return Wallets.Any(x => x.ChaumianClient?.State.AnyCoinsQueued() is true);
- }
- }
}
}

Remove Chaumian CoinJoinClient from wallet.cs