Raise from setter
MODIFY
WalletWasabi/BitcoinCore/Monitoring/RpcFeeProvider.cs
WalletWasabi/BitcoinCore/Monitoring/RpcFeeProvider.cs
@@ -13,10 +13,10 @@ namespace WalletWasabi.BitcoinCore.Monitoring
{
public class RpcFeeProvider : PeriodicRunner, IFeeProvider
{
- private AllFeeEstimate _allFeeEstimate;
-
public event EventHandler<AllFeeEstimate> AllFeeEstimateChanged;
+ private AllFeeEstimate _allFeeEstimate;
+
public AllFeeEstimate AllFeeEstimate
{
get => _allFeeEstimate;

MODIFY
WalletWasabi/BitcoinCore/Monitoring/RpcMonitor.cs
WalletWasabi/BitcoinCore/Monitoring/RpcMonitor.cs
@@ -12,9 +12,22 @@ namespace WalletWasabi.BitcoinCore.Monitoring
{
public class RpcMonitor : PeriodicRunner
{
+ private RpcStatus _rpcStatus;
+
public RPCClient RpcClient { get; set; }
- public RpcStatus RpcStatus { get; private set; }
+ public RpcStatus RpcStatus
+ {
+ get => _rpcStatus;
+ private set
+ {
+ if (value != _rpcStatus)
+ {
+ _rpcStatus = value;
+ RpcStatusChanged?.Invoke(this, value);
+ }
+ }
+ }
public event EventHandler<RpcStatus> RpcStatusChanged;
@@ -26,12 +39,7 @@ namespace WalletWasabi.BitcoinCore.Monitoring
protected override async Task ActionAsync(CancellationToken cancel)
{
- var rpcStatus = await RpcClient.GetRpcStatusAsync(cancel).ConfigureAwait(false);
- if (rpcStatus != RpcStatus)
- {
- RpcStatus = rpcStatus;
- RpcStatusChanged?.Invoke(this, rpcStatus);
- }
+ RpcStatus = await RpcClient.GetRpcStatusAsync(cancel).ConfigureAwait(false);
}
}
}

MODIFY
WalletWasabi/Blockchain/Analysis/FeesEstimation/FeeProviders.cs
WalletWasabi/Blockchain/Analysis/FeesEstimation/FeeProviders.cs
@@ -15,7 +15,20 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
{
public event EventHandler<AllFeeEstimate> AllFeeEstimateChanged;
- public AllFeeEstimate AllFeeEstimate { get; private set; }
+ private AllFeeEstimate _allFeeEstimate;
+
+ public AllFeeEstimate AllFeeEstimate
+ {
+ get => _allFeeEstimate;
+ private set
+ {
+ if (value != _allFeeEstimate)
+ {
+ _allFeeEstimate = value;
+ AllFeeEstimateChanged?.Invoke(this, value);
+ }
+ }
+ }
private IEnumerable<IFeeProvider> Providers { get; }
@@ -48,21 +61,14 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
{
IFeeProvider provider = providerArray[i];
var af = provider.AllFeeEstimate;
- if (af != null && af.IsAccurate && af != AllFeeEstimate)
+ if (af != null && af.IsAccurate)
{
AllFeeEstimate = af;
- AllFeeEstimateChanged?.Invoke(this, af);
return;
}
}
- var allFee = providerArray[^1].AllFeeEstimate;
- if (allFee != AllFeeEstimate)
- {
- AllFeeEstimate = allFee;
- AllFeeEstimateChanged?.Invoke(this, allFee);
- return;
- }
+ AllFeeEstimate = providerArray[^1].AllFeeEstimate;
}
}

MODIFY
WalletWasabi/Services/UpdateChecker.cs
WalletWasabi/Services/UpdateChecker.cs
@@ -13,9 +13,22 @@ namespace WalletWasabi.Services
{
public class UpdateChecker : PeriodicRunner
{
+ private UpdateStatus _updateStatus;
+
public WasabiClient WasabiClient { get; }
- public UpdateStatus UpdateStatus { get; private set; }
+ public UpdateStatus UpdateStatus
+ {
+ get => _updateStatus;
+ private set
+ {
+ if (value != _updateStatus)
+ {
+ _updateStatus = value;
+ UpdateStatusChanged?.Invoke(this, value);
+ }
+ }
+ }
public event EventHandler<UpdateStatus> UpdateStatusChanged;
@@ -27,12 +40,7 @@ namespace WalletWasabi.Services
protected override async Task ActionAsync(CancellationToken cancel)
{
- var updateStatus = await WasabiClient.CheckUpdatesAsync(cancel).ConfigureAwait(false);
- if (updateStatus != UpdateStatus)
- {
- UpdateStatus = updateStatus;
- UpdateStatusChanged?.Invoke(this, updateStatus);
- }
+ UpdateStatus = await WasabiClient.CheckUpdatesAsync(cancel).ConfigureAwait(false);
}
}
}

Raise from setter