add thresholds to Config
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
@@ -88,7 +88,9 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
if (_isSilent)
{
- var blockTarget = GetBestBlockTarget(feeEstimations);
+ var satPerByteThreshold = Services.Config.SatPerByteThreshold;
+ var blockTargetThreshold = Services.Config.BlockTargetThreshold;
+ var blockTarget = GetBestBlockTarget(feeEstimations, satPerByteThreshold, blockTargetThreshold);
FeeChart.CurrentConfirmationTarget = blockTarget;
_transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(blockTarget);
@@ -102,11 +104,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
});
}
- private int GetBestBlockTarget(Dictionary<int, int> estimations)
+ private int GetBestBlockTarget(Dictionary<int, int> estimations, int satPerByteThreshold, int blockTargetThreshold)
{
- var satPerByteThreshold = 10;
- var blockTargetThreshold = 6;
-
var bestBlockTarget = estimations.FirstOrDefault(x => x.Value <= satPerByteThreshold && x.Key <= blockTargetThreshold);
if (bestBlockTarget.Key != default && bestBlockTarget.Value != default)
{
@@ -126,12 +125,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private static readonly Dictionary<int, int> TestNetFeeEstimates = new ()
{
[1] = 17,
- [2] = 15,
- [3] = 11,
- [6] = 11,
- [18] = 9,
- [36] = 7,
- [72] = 5,
+ [2] = 12,
+ [3] = 9,
+ [6] = 9,
+ [18] = 2,
+ [36] = 2,
+ [72] = 2,
[144] = 2,
[432] = 1,
[1008] = 1

MODIFY
WalletWasabi.Gui/Config.cs
WalletWasabi.Gui/Config.cs
@@ -23,6 +23,8 @@ namespace WalletWasabi.Gui
public const int DefaultPrivacyLevelFine = 21;
public const int DefaultPrivacyLevelStrong = 50;
public const int DefaultJsonRpcServerPort = 37128;
+ public const int DefaultBlockTargetThreshold = 6;
+ public const int DefaultSatPerByteThreshold = 10;
public static readonly Money DefaultDustThreshold = Money.Coins(Constants.DefaultDustThreshold);
private Uri _backendUri = null;
@@ -193,6 +195,14 @@ namespace WalletWasabi.Gui
[JsonConverter(typeof(MoneyBtcJsonConverter))]
public Money DustThreshold { get; internal set; } = DefaultDustThreshold;
+ [DefaultValue(DefaultBlockTargetThreshold)]
+ [JsonProperty(PropertyName = nameof(BlockTargetThreshold), DefaultValueHandling = DefaultValueHandling.Populate)]
+ public int BlockTargetThreshold { get; private set; }
+
+ [DefaultValue(DefaultSatPerByteThreshold)]
+ [JsonProperty(PropertyName = nameof(SatPerByteThreshold), DefaultValueHandling = DefaultValueHandling.Populate)]
+ public int SatPerByteThreshold { get; private set; }
+
public ServiceConfiguration ServiceConfiguration { get; private set; }
public Uri GetCurrentBackendUri()

add thresholds to Config