Give back ISet so no need for HashSet
MODIFY
WalletWasabi/Services/MemPoolService.cs
WalletWasabi/Services/MemPoolService.cs
@@ -120,9 +120,8 @@ namespace WalletWasabi.Services
{
var compactness = 10;
var allMempoolHashes = await client.GetMempoolHashesAsync(compactness);
- var allMempoolHashesHashSet = allMempoolHashes.ToHashSet();
- var toRemove = TransactionHashes.Where(x => !allMempoolHashesHashSet.Contains(x.ToString().Substring(0, compactness)));
+ var toRemove = TransactionHashes.Where(x => !allMempoolHashes.Contains(x.ToString().Substring(0, compactness)));
foreach (uint256 tx in toRemove.ToArray())
{

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -306,11 +306,9 @@ namespace WalletWasabi.Services
var mempoolHashes = await client.GetMempoolHashesAsync(compactness);
- var mempoolSet = mempoolHashes.ToHashSet();
-
foreach (var tx in transactions)
{
- if (mempoolSet.Any(x => x == tx.GetHash().ToString().Substring(0, compactness)))
+ if (mempoolHashes.Any(x => x == tx.GetHash().ToString().Substring(0, compactness)))
{
tx.SetHeight(Height.MemPool);
ProcessTransaction(tx);

MODIFY
WalletWasabi/WebClients/Wasabi/WasabiClient.cs
WalletWasabi/WebClients/Wasabi/WasabiClient.cs
@@ -155,7 +155,7 @@ namespace WalletWasabi.WebClients.Wasabi
/// Gets mempool hashes, but strips the last x characters of each hash.
/// </summary>
/// <param name="compactness">1 to 64</param>
- public async Task<IEnumerable<string>> GetMempoolHashesAsync(int compactness, CancellationToken cancel = default)
+ public async Task<ISet<string>> GetMempoolHashesAsync(int compactness, CancellationToken cancel = default)
{
using (var response = await TorClient.SendAndRetryAsync(HttpMethod.Get,
HttpStatusCode.OK,
@@ -169,7 +169,7 @@ namespace WalletWasabi.WebClients.Wasabi
using (HttpContent content = response.Content)
{
- var strings = await content.ReadAsJsonAsync<IEnumerable<string>>();
+ var strings = await content.ReadAsJsonAsync<ISet<string>>();
return strings;
}
}

Give back ISet so no need for HashSet