Use more efficient search
MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -619,7 +619,7 @@ namespace WalletWasabi.Services
TransactionCache.TryAdd(tx);
// If it's being mixed and anonset is not sufficient, then queue it.
- if (newCoin.Unspent && ChaumianClient.HasIngredients && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet && SpendsEnqueued(newCoin.SpentOutputs))
+ if (newCoin.Unspent && ChaumianClient.HasIngredients && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet && ChaumianClient.State.Contains(newCoin.SpentOutputs))
{
Task.Run(async () =>
{
@@ -676,24 +676,6 @@ namespace WalletWasabi.Services
return walletRelevant;
}
- /// <summary>
- /// Tests if a transaction already spends an enqueued coin or not.
- /// </summary>
- private bool SpendsEnqueued(IEnumerable<TxoRef> spentInputs)
- {
- foreach (var input in spentInputs)
- {
- // If it's enqueued.
- var enqueued = ChaumianClient.State.GetSingleOrDefaultCoin(new TxoRef(input.TransactionId, input.Index));
- if (enqueued != null)
- {
- return true;
- }
- }
-
- return false;
- }
-
public Node LocalBitcoinCoreNode
{
get

Use more efficient search