"reset" CTSource when change happens
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
@@ -34,7 +34,7 @@ public partial class PrivacySuggestionsFlyoutViewModel : ViewModelBase
public ObservableCollection<SuggestionViewModel> Suggestions { get; }
- public async Task BuildPrivacySuggestionsAsync(Wallet wallet, TransactionInfo info, BitcoinAddress destination, BuildTransactionResult transaction, CancellationToken cancellationToken = default)
+ public async Task BuildPrivacySuggestionsAsync(Wallet wallet, TransactionInfo info, BitcoinAddress destination, BuildTransactionResult transaction, CancellationToken cancellationToken)
{
Suggestions.Clear();
SelectedSuggestion = null;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -189,7 +189,14 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
{
UpdateTransaction(CurrentTransactionSummary, newTransaction);
- await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, newTransaction);
+ // Cancel and dispose old token source.
+ _cancellationTokenSource.Cancel();
+ _cancellationTokenSource.Dispose();
+
+ // Start the new search with a fresh token source.
+ _cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(15));
+
+ await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, newTransaction, _cancellationTokenSource.Token);
}
}

"reset" CTSource when change happens