Undo feature
MODIFY
WalletWasabi/Extensions/RPCClientExtensions.cs
WalletWasabi/Extensions/RPCClientExtensions.cs
@@ -69,33 +69,18 @@ namespace NBitcoin.RPC
/// </summary>
public static async Task<AllFeeEstimate> EstimateAllFeeAsync(this IRPCClient rpc, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, bool simulateIfRegTest = false)
{
- NoEstimationException? noe = null;
- Dictionary<int, int>? smartEstimations = null;
- try
- {
- smartEstimations = (simulateIfRegTest && rpc.Network == Network.RegTest)
+ var smartEstimations = (simulateIfRegTest && rpc.Network == Network.RegTest)
? SimulateRegTestFeeEstimation(estimateMode)
: await GetFeeEstimationsAsync(rpc, estimateMode).ConfigureAwait(false);
- }
- catch (NoEstimationException ex)
- {
- noe = ex;
- }
var mempoolInfo = await rpc.GetMempoolInfoAsync().ConfigureAwait(false);
- if ((mempoolInfo.Histogram is null || !mempoolInfo.Histogram.Any()) && noe is not null)
- {
- throw noe;
- }
-
var sanityFeeRate = mempoolInfo.GetSanityFeeRate();
var rpcStatus = await rpc.GetRpcStatusAsync(CancellationToken.None).ConfigureAwait(false);
var minEstimations = GetFeeEstimationsFromMempoolInfo(mempoolInfo);
- var fixedEstimations =
- smartEstimations?
+ var fixedEstimations = smartEstimations
.GroupJoin(
minEstimations,
outer => outer.Key,
@@ -106,8 +91,7 @@ namespace NBitcoin.RPC
(a, b) => (
Target: a.Estimation.Key,
FeeRate: Math.Max((int)sanityFeeRate.SatoshiPerByte, Math.Max(a.Estimation.Value, b.Value))))
- .ToDictionary(x => x.Target, x => x.FeeRate)
- ?? minEstimations;
+ .ToDictionary(x => x.Target, x => x.FeeRate);
return new AllFeeEstimate(
estimateMode,

Undo feature