Further lean down Synchronizer
MODIFY
WalletWasabi/Backend/Models/Responses/SynchronizeResponse.cs
WalletWasabi/Backend/Models/Responses/SynchronizeResponse.cs
@@ -18,7 +18,7 @@ namespace WalletWasabi.Backend.Models.Responses
public IEnumerable<RoundStateResponseBase> CcjRoundStates { get; set; }
- public AllFeeEstimate AllFeeEstimate { get; set; }
+ public AllFeeEstimate? AllFeeEstimate { get; set; }
public IEnumerable<ExchangeRate> ExchangeRates { get; set; }

MODIFY
WalletWasabi/Blockchain/Analysis/FeesEstimation/HybridFeeProvider.cs
WalletWasabi/Blockchain/Analysis/FeesEstimation/HybridFeeProvider.cs
using System;
using System.Collections.Generic;
using System.Linq;
+using WalletWasabi.Backend.Models.Responses;
using WalletWasabi.BitcoinCore.Monitoring;
using WalletWasabi.Logging;
using WalletWasabi.Services;
@@ -20,7 +21,7 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
Synchronizer = synchronizer;
RpcFeeProvider = rpcFeeProvider;
- Synchronizer.AllFeeEstimateArrived += OnAllFeeEstimateArrived;
+ Synchronizer.ResponseArrived += Synchronizer_ResponseArrived;
if (RpcFeeProvider is not null)
{
@@ -36,6 +37,11 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
}
}
+ private void Synchronizer_ResponseArrived(object? sender, SynchronizeResponse response)
+ {
+ OnAllFeeEstimateArrived(sender, response.AllFeeEstimate);
+ }
+
public event EventHandler<AllFeeEstimate>? AllFeeEstimateChanged;
public WasabiSynchronizer Synchronizer { get; }
@@ -43,7 +49,7 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
private object Lock { get; } = new object();
public AllFeeEstimate? AllFeeEstimate { get; private set; }
- private void OnAllFeeEstimateArrived(object? sender, AllFeeEstimate fees)
+ private void OnAllFeeEstimateArrived(object? sender, AllFeeEstimate? fees)
{
// Only go further if we have estimations.
if (fees?.Estimations?.Any() is not true)
@@ -115,7 +121,7 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
{
if (disposing)
{
- Synchronizer.AllFeeEstimateArrived -= OnAllFeeEstimateArrived;
+ Synchronizer.ResponseArrived -= Synchronizer_ResponseArrived;
if (RpcFeeProvider is not null)
{

MODIFY
WalletWasabi/Services/WasabiSynchronizer.cs
WalletWasabi/Services/WasabiSynchronizer.cs
@@ -56,8 +56,6 @@ namespace WalletWasabi.Services
#region EventsPropertiesMembers
- public event EventHandler<AllFeeEstimate>? AllFeeEstimateArrived;
-
public event EventHandler<bool>? ResponseArrivedIsGenSocksServFail;
public event EventHandler<SynchronizeResponse>? ResponseArrived;
@@ -207,12 +205,6 @@ namespace WalletWasabi.Services
throw;
}
- var allFees = response.AllFeeEstimate;
- if (allFees?.Estimations?.Any() is true)
- {
- AllFeeEstimateArrived?.Invoke(this, allFees);
- }
-
if (response.Filters.Count() == maxFiltersToSyncAtInitialization)
{
ignoreRequestInterval = true;

Further lean down Synchronizer