Fix duplicate item exception in GetFeeEstimations
MODIFY
WalletWasabi/Extensions/LinqExtensions.cs
WalletWasabi/Extensions/LinqExtensions.cs
@@ -193,5 +193,10 @@ namespace System.Linq
}
return source.Zip(otherCollection);
}
+
+ public static IEnumerable<T> DistinctBy<T, TKey>(this IEnumerable<T> enumerable, Func<T, TKey> keySelector)
+ {
+ return enumerable.GroupBy(keySelector).Select(grp => grp.First());
+ }
}
}

MODIFY
WalletWasabi/Extensions/RPCClientExtensions.cs
WalletWasabi/Extensions/RPCClientExtensions.cs
@@ -109,6 +109,7 @@ namespace NBitcoin.RPC
return rpcFeeEstimationTasks
.Where(x => x.IsCompletedSuccessfully)
.Select(x => x.Result)
+ .DistinctBy(x => x.Blocks)
.ToDictionary(x => x.Blocks, x => (int)Math.Ceiling(x.FeeRate.SatoshiPerByte));
}

Fix duplicate item exception in GetFeeEstimations