Wait until fee provider can provide something
MODIFY
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
+using System.Threading.Tasks;
using NBitcoin;
using WalletWasabi.Fluent.ViewModels.Wallets.Send;
using WalletWasabi.Wallets;
@@ -25,6 +26,26 @@ public static class TransactionFeeHelper
[1008] = 1
};
+ public static async Task<Dictionary<int, int>?> GetFeeEstimatesWhenReadyAsync(Wallet wallet)
+ {
+ var feeProvider = wallet.FeeProvider;
+
+ bool RpcFeeProviderInError() => feeProvider.RpcFeeProvider?.InError ?? true;
+ bool ThirdPartyFeeProviderInError() => feeProvider.ThirdPartyFeeProvider.InError;
+
+ while (!RpcFeeProviderInError() || !ThirdPartyFeeProviderInError())
+ {
+ if (TryGetFeeEstimates(wallet, out var feeEstimates))
+ {
+ return feeEstimates;
+ }
+
+ await Task.Delay(100);
+ }
+
+ return null;
+ }
+
public static bool TryGetFeeEstimates(Wallet wallet, [NotNullWhen(true)] out Dictionary<int, int>? estimates)
{
estimates = null;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
-using System.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
@@ -6,7 +5,6 @@ using System.Threading.Tasks;
using System.Windows.Input;
using NBitcoin;
using ReactiveUI;
-using WalletWasabi.Blockchain.Analysis.FeesEstimation;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Wallets;
@@ -92,7 +90,9 @@ public partial class SendFeeViewModel : DialogViewModelBase<FeeRate>
RxApp.MainThreadScheduler.Schedule(async () =>
{
- if (!TransactionFeeHelper.TryGetFeeEstimates(_wallet, out var feeEstimates))
+ var feeEstimates = await TransactionFeeHelper.GetFeeEstimatesWhenReadyAsync(_wallet);
+
+ if (feeEstimates is null)
{
await ShowErrorAsync(
"Transaction fee",

Wait until fee provider can provide something