FilterModel serialization
MODIFY
WalletWasabi.Backend/Controllers/BatchController.cs
WalletWasabi.Backend/Controllers/BatchController.cs
@@ -52,10 +52,10 @@ namespace WalletWasabi.Backend.Controllers
var knownHash = new uint256(bestKnownBlockHash);
- (Height bestHeight, IEnumerable<string> filters) = Global.IndexBuilderService.GetFilterLinesExcluding(knownHash, maxNumberOfFilters, out bool found);
+ (Height bestHeight, IEnumerable<FilterModel> filters) = Global.IndexBuilderService.GetFilterLinesExcluding(knownHash, maxNumberOfFilters, out bool found);
var response = new SynchronizeResponse();
- response.Filters = new string[0];
+ response.Filters = new List<FilterModel>();
response.BestHeight = bestHeight;
if (!found)

MODIFY
WalletWasabi.Backend/Controllers/BlockchainController.cs
WalletWasabi.Backend/Controllers/BlockchainController.cs
@@ -229,7 +229,7 @@ namespace WalletWasabi.Backend.Controllers
var knownHash = new uint256(bestKnownBlockHash);
- (Height bestHeight, IEnumerable<string> filters) = Global.IndexBuilderService.GetFilterLinesExcluding(knownHash, count, out bool found);
+ (Height bestHeight, IEnumerable<FilterModel> filters) = Global.IndexBuilderService.GetFilterLinesExcluding(knownHash, count, out bool found);
if (!found)
{

MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -206,7 +206,7 @@ namespace WalletWasabi.Tests
for (int i = 0; i < 111; i++)
{
var expectedHash = await rpc.GetBlockHashAsync(i + 1);
- var filterModel = FilterModel.FromLine(filters[i], i);
+ var filterModel = filters[i];
Assert.Equal(expectedHash, filterModel.BlockHash);
}
}

MODIFY
WalletWasabi/Backend/Models/Responses/SynchronizeResponse.cs
WalletWasabi/Backend/Models/Responses/SynchronizeResponse.cs
@@ -8,7 +8,9 @@ namespace WalletWasabi.Backend.Models.Responses
public class SynchronizeResponse
{
public FiltersResponseState FiltersResponseState { get; set; }
- public IEnumerable<string> Filters { get; set; }
+
+
+ public IEnumerable<FilterModel> Filters { get; set; }
public int BestHeight { get; set; }

MODIFY
WalletWasabi/Services/IndexBuilderService.cs
WalletWasabi/Services/IndexBuilderService.cs
@@ -368,17 +368,17 @@ namespace WalletWasabi.Services
});
}
- public (Height bestHeight, IEnumerable<string> filters) GetFilterLinesExcluding(uint256 bestKnownBlockHash, int count, out bool found)
+ public (Height bestHeight, IEnumerable<FilterModel> filters) GetFilterLinesExcluding(uint256 bestKnownBlockHash, int count, out bool found)
{
using (IndexLock.Lock())
{
found = false; // Only build the filter list from when the known hash is found.
- var filters = new List<string>();
+ var filters = new List<FilterModel>();
foreach (var filter in Index)
{
if (found)
{
- filters.Add(filter.ToLine());
+ filters.Add(filter);
if (filters.Count >= count)
{
break;
@@ -395,7 +395,7 @@ namespace WalletWasabi.Services
if (Index.Count == 0)
{
- return (Height.Unknown, Enumerable.Empty<string>());
+ return (Height.Unknown, Enumerable.Empty<FilterModel>());
}
else
{

MODIFY
WalletWasabi/Services/WasabiSynchronizer.cs
WalletWasabi/Services/WasabiSynchronizer.cs
@@ -310,14 +310,14 @@ namespace WalletWasabi.Services
if (response.FiltersResponseState == FiltersResponseState.NewFilters)
{
- List<string> filtersList = response.Filters.ToList(); // performance
+ List<FilterModel> filtersList = response.Filters.ToList(); // performance
for (int i = 0; i < filtersList.Count; i++)
{
FilterModel filterModel;
lock (IndexLock)
{
- filterModel = FilterModel.FromLine(filtersList[i], BestKnownFilter.BlockHeight + 1);
+ filterModel = filtersList[i];
Index.Add(filterModel);
BestKnownFilter = filterModel;
}

FilterModel serialization