Generalize ctor
MODIFY
WalletWasabi/Blockchain/Analysis/FeesEstimation/FeeProviders.cs
WalletWasabi/Blockchain/Analysis/FeesEstimation/FeeProviders.cs
@@ -8,21 +8,20 @@ namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
{
public class FeeProviders : IFeeProvider, IDisposable
{
- public FeeProviders(WasabiSynchronizer synchronizer, params IFeeProvider[] extraFeeProviders)
+ public FeeProviders(IFeeProvider baseProvider, params IFeeProvider[]? feeProviders)
{
Lock = new object();
- Providers = new List<IFeeProvider>
- {
- synchronizer
- };
+ Providers = new List<IFeeProvider>();
- foreach (var provider in extraFeeProviders.Where(x => x is { }))
+ if (feeProviders is { })
{
- // Backend(synchronizer) fee provider is always the last provider.
- Providers.Insert(0, provider);
+ Providers.AddRange(feeProviders.Where(x => x is { }));
}
+ // Backend(synchronizer) fee provider is always the last provider.
+ Providers.Add(baseProvider);
+
foreach (var provider in Providers)
{
provider.AllFeeEstimateChanged += Provider_AllFeeEstimateChanged;

Generalize ctor