Using Count method, removed redundant checks
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -55,7 +55,7 @@ namespace WalletWasabi.Tests
var filters = await client.GetFiltersAsync(firstHash, 1000);
Assert.True(filters.NotNullAndNotEmpty());
- var filterCount = filters.ToList().Count;
+ var filterCount = filters.Count();
if (filterCount >= 101)
{
break;

MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -129,12 +129,10 @@ namespace WalletWasabi.Services
var filters = await WasabiClient.GetFiltersAsync(bestKnownFilter.BlockHash, 1000);
- if (filters != null && !filters.Any())
+ if (!filters.Any())
{
continue;
}
- if (filters.NotNullAndNotEmpty())
- {
using (await IndexLock.LockAsync())
{
var filtersList = filters.ToList(); // performance
@@ -160,8 +158,7 @@ namespace WalletWasabi.Services
continue;
}
- }
- catch (HttpRequestException ex) when (bestKnownFilter != null && ex.Message.StartsWith("Not Found\nProvided bestKnownBlockHash is not found:"))
+ catch (HttpRequestException ex) when (ex.Message.StartsWith(HttpStatusCode.NotFound.ToReasonString()))
{
// Reorg happened
var reorgedHash = bestKnownFilter.BlockHash;

Using Count method, removed redundant checks